From 66b333273e35c8cf521c10dc6e20e04af6bf1fdc Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 5 Nov 2023 10:51:30 +0100 Subject: [PATCH] test: add a test for an entity containing a dateTime property --- .../util/DataRepresentationUtilsTests.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt index c92694e33..9157c7345 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt @@ -70,6 +70,26 @@ class DataRepresentationUtilsTests { rawEntity.deserializeAsMap().checkNamesAreNgsiLdSupported().shouldSucceed() } + @Test + fun `it should validate an entity with special characters in the value of a property`() = runTest { + val rawEntity = + """ + { + "id": "urn:ngsi-ld:Device:01234", + "type": "Property", + "dateObserved": { + "type": "Property", + "value": { + "@type": "DateTime", + "@value": "2023-11-05T12:00:00Z" + } + } + } + """.trimIndent() + + rawEntity.deserializeAsMap().checkNamesAreNgsiLdSupported().shouldSucceed() + } + @Test fun `it should not validate an entity with an invalid attribute name`() = runTest { val rawEntity =