File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
src/test/java/org/json/junit Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ repositories {
2121
2222dependencies {
2323 testImplementation ' junit:junit:4.13.2'
24- testImplementation ' com.jayway.jsonpath:json-path:2.1 .0'
24+ testImplementation ' com.jayway.jsonpath:json-path:2.4 .0'
2525 testImplementation ' org.mockito:mockito-core:4.2.0'
2626}
2727
Original file line number Diff line number Diff line change 7070 <dependency >
7171 <groupId >com.jayway.jsonpath</groupId >
7272 <artifactId >json-path</artifactId >
73- <version >2.1 .0</version >
73+ <version >2.4 .0</version >
7474 <scope >test</scope >
7575 </dependency >
7676 <dependency >
Original file line number Diff line number Diff line change @@ -1184,7 +1184,9 @@ public void shouldCreateExplicitEndTagWithEmptyValueWhenConfigured(){
11841184 JSONObject jsonObject = new JSONObject (jsonString );
11851185 String expectedXmlString = "<encloser><outer><innerOne></innerOne><innerTwo>two</innerTwo></outer></encloser>" ;
11861186 String xmlForm = XML .toString (jsonObject ,"encloser" , new XMLParserConfiguration ().withCloseEmptyTag (true ));
1187- assertEquals (expectedXmlString , xmlForm );
1187+ JSONObject actualJsonObject = XML .toJSONObject (xmlForm );
1188+ JSONObject expectedJsonObject = XML .toJSONObject (expectedXmlString );
1189+ assertTrue (expectedJsonObject .similar (actualJsonObject ));
11881190 }
11891191
11901192 @ Test
@@ -1193,7 +1195,9 @@ public void shouldNotCreateExplicitEndTagWithEmptyValueWhenNotConfigured(){
11931195 JSONObject jsonObject = new JSONObject (jsonString );
11941196 String expectedXmlString = "<encloser><outer><innerOne/><innerTwo>two</innerTwo></outer></encloser>" ;
11951197 String xmlForm = XML .toString (jsonObject ,"encloser" , new XMLParserConfiguration ().withCloseEmptyTag (false ));
1196- assertEquals (expectedXmlString , xmlForm );
1198+ JSONObject actualJsonObject = XML .toJSONObject (xmlForm );
1199+ JSONObject expectedJsonObject = XML .toJSONObject (expectedXmlString );
1200+ assertTrue (expectedJsonObject .similar (actualJsonObject ));
11971201 }
11981202
11991203
You can’t perform that action at this time.
0 commit comments