~jan0sch/smederee
Showing details for patch ab7448ac7a0748a016a9c3ef5933b31242015e3f.
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)