We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c026eb commit f48b643Copy full SHA for f48b643
XMLTest.java
@@ -321,4 +321,20 @@ public void shouldHandleIllegalJSONNodeNames()
321
322
assertEquals(expected, result);
323
}
324
+
325
+ @Test
326
+ public void shouldHandleNullNodeValue()
327
+ {
328
+ JSONObject inputJSON = new JSONObject();
329
+ inputJSON.put("nullValue", JSONObject.NULL);
330
+ // This is a possible preferred result
331
+ String expectedXML = "<nullValue/>";
332
+ String actualXML = "<nullValue>null</nullValue>";
333
+ /**
334
+ * This is the current behavior. JSONObject.NULL is emitted as
335
+ * the string, "null".
336
+ */
337
+ String resultXML = XML.toString(inputJSON);
338
+ assertEquals(actualXML, resultXML);
339
+ }
340
0 commit comments