mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-08 03:24:27 +08:00
Merge pull request #543 from johnjaylward/RefactorXmlConfiguration
Refactor XMLConfiguration to use Builder Pattern
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user