~jan0sch/smederee

Showing details for patch ab7448ac7a0748a016a9c3ef5933b31242015e3f.
2024-05-06 (Mon), 4:52 PM - Jens Grassel - ab7448ac7a0748a016a9c3ef5933b31242015e3f

security: Add test for UserId.from

Summary of changes
1 files modified with 6 lines added and 0 lines removed
  • modules/security/src/test/scala/de/smederee/security/UserIdTest.scala with 6 added and 0 removed lines
diff -rN -u old-smederee/modules/security/src/test/scala/de/smederee/security/UserIdTest.scala new-smederee/modules/security/src/test/scala/de/smederee/security/UserIdTest.scala
--- old-smederee/modules/security/src/test/scala/de/smederee/security/UserIdTest.scala	2025-01-11 22:57:47.669647738 +0000
+++ new-smederee/modules/security/src/test/scala/de/smederee/security/UserIdTest.scala	2025-01-11 22:57:47.669647738 +0000
@@ -30,6 +30,12 @@
     private val genUUID: Gen[UUID] = Gen.delay(UUID.randomUUID)
     given Arbitrary[UUID]          = Arbitrary(genUUID)
 
+    property("UserId.from must accept UUIDs") {
+        forAll { (uuid: UUID) =>
+            assert(UserId.from(uuid).exists(_.toUUID === uuid))
+        }
+    }
+
     property("UserId.fromString must fail on invalid input") {
         forAll { (input: String) =>
             assert(UserId.fromString(input).isLeft)