File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/test/java/org/json/junit Expand file tree Collapse file tree 1 file changed +6
-2
lines changed 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