Skip to content

Commit

Permalink
test: add a test for an entity containing a dateTime property
Browse files Browse the repository at this point in the history
  • Loading branch information
bobeal committed Nov 5, 2023
1 parent 5a57580 commit 66b3332
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 66b3332

Please sign in to comment.