mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
Use better name for parser configuration option, fix API comment.
This commit is contained in:
@@ -235,7 +235,7 @@ public class JSONArrayTest {
|
||||
Map<String, Object> sub = new HashMap<String, Object>();
|
||||
sub.put("nullKey", null);
|
||||
list.add(sub);
|
||||
JSONParserConfiguration parserConfiguration = new JSONParserConfiguration().withJavaNullAsJsonNull(true);
|
||||
JSONParserConfiguration parserConfiguration = new JSONParserConfiguration().withUseNativeNulls(true);
|
||||
JSONArray jsonArray = new JSONArray(list, parserConfiguration);
|
||||
JSONObject subObject = jsonArray.getJSONObject(0);
|
||||
assertTrue(subObject.has("nullKey"));
|
||||
|
||||
@@ -627,7 +627,7 @@ public class JSONObjectTest {
|
||||
assertTrue("expected null value to be ignored by default", obj1.isEmpty());
|
||||
|
||||
// if configured, null values are written as such into the JSONObject.
|
||||
JSONParserConfiguration parserConfiguration = new JSONParserConfiguration().withJavaNullAsJsonNull(true);
|
||||
JSONParserConfiguration parserConfiguration = new JSONParserConfiguration().withUseNativeNulls(true);
|
||||
JSONObject obj2 = new JSONObject(map, parserConfiguration);
|
||||
assertFalse("expected null value to accepted when configured", obj2.isEmpty());
|
||||
assertTrue(obj2.has("nullKey"));
|
||||
@@ -644,7 +644,7 @@ public class JSONObjectTest {
|
||||
nestedList.add(nestedMap);
|
||||
map.put("nestedList", nestedList);
|
||||
|
||||
JSONParserConfiguration parserConfiguration = new JSONParserConfiguration().withJavaNullAsJsonNull(true);
|
||||
JSONParserConfiguration parserConfiguration = new JSONParserConfiguration().withUseNativeNulls(true);
|
||||
JSONObject jsonObject = new JSONObject(map, parserConfiguration);
|
||||
|
||||
JSONObject nestedObject = jsonObject.getJSONObject("nestedMap");
|
||||
|
||||
Reference in New Issue
Block a user