diff --git a/morphir/sdk/core/jvm/src/morphir/sdk/UUID.scala b/morphir/sdk/core/jvm/src/morphir/sdk/UUID.scala index d83b9af..ce3d802 100644 --- a/morphir/sdk/core/jvm/src/morphir/sdk/UUID.scala +++ b/morphir/sdk/core/jvm/src/morphir/sdk/UUID.scala @@ -17,10 +17,10 @@ object UUID { val Nil: UUID = MUUID.Nil - val dnsNamespace = "6ba7b810-9dad-11d1-80b4-00c04fd430c8" - val urlNamespace = "6ba7b811-9dad-11d1-80b4-00c04fd430c8" - val oidNamespace = "6ba7b812-9dad-11d1-80b4-00c04fd430c8" - val x500Namespace = "6ba7b814-9dad-11d1-80b4-00c04fd430c8" + val dnsNamespace: UUID = memeid.UUID.fromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8") + val urlNamespace: UUID = memeid.UUID.fromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8") + val oidNamespace: UUID = memeid.UUID.fromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8") + val x500Namespace: UUID = memeid.UUID.fromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8") def compare(uuid1: UUID)(uuid2: UUID): Int = uuid1.compareTo(uuid2) def forName(s: String)(uuid: UUID): UUID = MUUID.V5(uuid, s) diff --git a/morphir/sdk/core/test/jvm/src/UUIDSpec.scala b/morphir/sdk/core/test/jvm/src/UUIDSpec.scala index a411199..157ec45 100644 --- a/morphir/sdk/core/test/jvm/src/UUIDSpec.scala +++ b/morphir/sdk/core/test/jvm/src/UUIDSpec.scala @@ -69,6 +69,24 @@ object UUIDSpec extends MorphirBaseSpec { val u2 = UUID.forName(name2)(namespace) assertTrue(u1 != u2) } + ), + suite("Known namespaces")( + test("dnsNamespace should be a valid UUID") { + val uuid = UUID.dnsNamespace + assertTrue(uuid.isInstanceOf[UUID.UUID]) + }, + test("urlNamespace should be a valid UUID") { + val uuid = UUID.urlNamespace + assertTrue(uuid.isInstanceOf[UUID.UUID]) + }, + test("oidNamespace should be a valid UUID") { + val uuid = UUID.oidNamespace + assertTrue(uuid.isInstanceOf[UUID.UUID]) + }, + test("x500Namespace should be a valid UUID") { + val uuid = UUID.x500Namespace + assertTrue(uuid.isInstanceOf[UUID.UUID]) + } ) )