Merge pull request #543 from johnjaylward/RefactorXmlConfiguration

Refactor XMLConfiguration to use Builder Pattern
This commit is contained in:
Sean Leary
2020-07-24 02:49:28 -05:00
committed by GitHub
5 changed files with 179 additions and 38 deletions

View File

@@ -893,7 +893,11 @@ public class XMLTest {
final String originalXml = "<root><id xsi:nil=\"true\"/></root>";
final String expectedJsonString = "{\"root\":{\"id\":null}}";
final JSONObject json = XML.toJSONObject(originalXml, new XMLParserConfiguration(false, "content", true));
final JSONObject json = XML.toJSONObject(originalXml,
new XMLParserConfiguration()
.withKeepStrings(false)
.withcDataTagName("content")
.withConvertNilAttributeToNull(true));
assertEquals(expectedJsonString, json.toString());
}