|
13 | 13 |
|
14 | 14 | package org.eclipse.esmf.ame.services; |
15 | 15 |
|
16 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
17 | 16 | import static org.junit.jupiter.api.Assertions.assertFalse; |
18 | 17 | import static org.junit.jupiter.api.Assertions.assertThrows; |
19 | 18 | import static org.junit.jupiter.api.Assertions.assertTrue; |
@@ -75,12 +74,19 @@ void testAspectModelJsonSample() throws IOException { |
75 | 74 | final String payload = generateService.sampleJSONPayload( mockedZipFile, URI.create( "blob:///" + toUriPath( storagePath ) ) ); |
76 | 75 |
|
77 | 76 | final ObjectMapper mapper = new ObjectMapper(); |
78 | | - final JsonNode expected = mapper.readTree( |
79 | | - "{\"isMoving\":true,\"position\":{\"altitude\":153.0,\"latitude\":9.1781,\"longitude\":48.80835},\"speed\":-1.9556407E38," |
80 | | - + "\"speedLimitWarning\":\"green\"}" ); |
81 | 77 | final JsonNode actual = mapper.readTree( payload ); |
82 | 78 |
|
83 | | - assertEquals( expected, actual ); |
| 79 | + // Verify keys exist at root level |
| 80 | + assertTrue( actual.has( "isMoving" ) ); |
| 81 | + assertTrue( actual.has( "position" ) ); |
| 82 | + assertTrue( actual.has( "speed" ) ); |
| 83 | + assertTrue( actual.has( "speedLimitWarning" ) ); |
| 84 | + |
| 85 | + // Verify nested keys in position object |
| 86 | + final JsonNode position = actual.get( "position" ); |
| 87 | + assertTrue( position.has( "altitude" ) ); |
| 88 | + assertTrue( position.has( "latitude" ) ); |
| 89 | + assertTrue( position.has( "longitude" ) ); |
84 | 90 | } |
85 | 91 |
|
86 | 92 | @Test |
|
0 commit comments