Merge remote-tracking branch 'origin/master' into feature-disable-whitespace-trim

This commit is contained in:
Keaton Taylor 2023-11-27 11:15:49 +02:00
commit 9ee10fdfc8
3 changed files with 8 additions and 4 deletions

View File

@ -21,7 +21,7 @@ repositories {
dependencies { dependencies {
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
testImplementation 'com.jayway.jsonpath:json-path:2.1.0' testImplementation 'com.jayway.jsonpath:json-path:2.4.0'
testImplementation 'org.mockito:mockito-core:4.2.0' testImplementation 'org.mockito:mockito-core:4.2.0'
} }

View File

@ -70,7 +70,7 @@
<dependency> <dependency>
<groupId>com.jayway.jsonpath</groupId> <groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId> <artifactId>json-path</artifactId>
<version>2.1.0</version> <version>2.4.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -1184,7 +1184,9 @@ public class XMLTest {
JSONObject jsonObject = new JSONObject(jsonString); JSONObject jsonObject = new JSONObject(jsonString);
String expectedXmlString = "<encloser><outer><innerOne></innerOne><innerTwo>two</innerTwo></outer></encloser>"; String expectedXmlString = "<encloser><outer><innerOne></innerOne><innerTwo>two</innerTwo></outer></encloser>";
String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(true)); String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(true));
assertEquals(expectedXmlString, xmlForm); JSONObject actualJsonObject = XML.toJSONObject(xmlForm);
JSONObject expectedJsonObject = XML.toJSONObject(expectedXmlString);
assertTrue(expectedJsonObject.similar(actualJsonObject));
} }
@Test @Test
@ -1193,7 +1195,9 @@ public class XMLTest {
JSONObject jsonObject = new JSONObject(jsonString); JSONObject jsonObject = new JSONObject(jsonString);
String expectedXmlString = "<encloser><outer><innerOne/><innerTwo>two</innerTwo></outer></encloser>"; String expectedXmlString = "<encloser><outer><innerOne/><innerTwo>two</innerTwo></outer></encloser>";
String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(false)); String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(false));
assertEquals(expectedXmlString, xmlForm); JSONObject actualJsonObject = XML.toJSONObject(xmlForm);
JSONObject expectedJsonObject = XML.toJSONObject(expectedXmlString);
assertTrue(expectedJsonObject.similar(actualJsonObject));
} }