Skip to content

Commit 9ee10fd

Browse files
author
Keaton Taylor
committed
Merge remote-tracking branch 'origin/master' into feature-disable-whitespace-trim
2 parents 09f3537 + 9299177 commit 9ee10fd

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repositories {
2121

2222
dependencies {
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

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
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>

src/test/java/org/json/junit/XMLTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)