|
5 | 5 | import jakarta.json.*; |
6 | 6 |
|
7 | 7 | import org.assertj.core.api.AutoCloseableSoftAssertions; |
8 | | -import org.eclipse.parsson.JsonPointerImpl; |
9 | 8 | import org.junit.jupiter.api.Test; |
10 | 9 |
|
11 | 10 | import io.smallrye.graphql.test.TestSourceConfiguration; |
@@ -61,15 +60,15 @@ public void testBasicListQuery() { |
61 | 60 | public void testBatchSourceConfigurationQuery() { |
62 | 61 | JsonObject data = executeAndGetData(TEST_BATCH_SOURCE_CONFIGURATION_QUERY); |
63 | 62 |
|
64 | | - JsonPointer active1Pointer = new JsonPointerImpl("/objectsWithConfig1/0/configuredSources/configuration/active"); |
65 | | - Boolean active1 = Boolean.valueOf(active1Pointer.getValue(data).toString()); |
66 | | - JsonPointer active2Pointer = new JsonPointerImpl("/objectsWithConfig2/0/configuredSources/configuration/active"); |
67 | | - Boolean active2 = Boolean.valueOf(active2Pointer.getValue(data).toString()); |
| 63 | + Boolean active1 = data.getJsonArray("objectsWithConfig1").get(0).asJsonObject().getJsonObject("configuredSources") |
| 64 | + .getJsonObject("configuration").getBoolean("active"); |
| 65 | + Boolean active2 = data.getJsonArray("objectsWithConfig2").get(0).asJsonObject().getJsonObject("configuredSources") |
| 66 | + .getJsonObject("configuration").getBoolean("active"); |
68 | 67 |
|
69 | | - JsonPointer state1Pointer = new JsonPointerImpl("/objectsWithConfig1/0/configuredSources/configuration/state"); |
70 | | - var state1 = TestSourceConfiguration.TestSourceState.valueOf(((JsonString) state1Pointer.getValue(data)).getString()); |
71 | | - JsonPointer state2Pointer = new JsonPointerImpl("/objectsWithConfig2/0/configuredSources/configuration/state"); |
72 | | - var state2 = TestSourceConfiguration.TestSourceState.valueOf(((JsonString) state2Pointer.getValue(data)).getString()); |
| 68 | + var state1 = TestSourceConfiguration.TestSourceState.valueOf(data.getJsonArray("objectsWithConfig1").get(0) |
| 69 | + .asJsonObject().getJsonObject("configuredSources").getJsonObject("configuration").getString("state")); |
| 70 | + var state2 = TestSourceConfiguration.TestSourceState.valueOf(data.getJsonArray("objectsWithConfig2").get(0) |
| 71 | + .asJsonObject().getJsonObject("configuredSources").getJsonObject("configuration").getString("state")); |
73 | 72 |
|
74 | 73 | try (AutoCloseableSoftAssertions softly = new AutoCloseableSoftAssertions()) { |
75 | 74 | softly.assertThat(active1).isNotEqualTo(active2); |
|
0 commit comments