Updates XML configuration to use a builder pattern instead of
constructors with many parameters
This commit is contained in:
John J. Aylward
2020-07-21 11:08:40 -04:00
parent 6ddaa13c1e
commit 5a31f9ef5f
5 changed files with 178 additions and 38 deletions

View File

@@ -883,7 +883,10 @@ 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());
}