mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 11:25:30 -04:00
Update JSONObjectTest.java
fixes test to be applicable
This commit is contained in:
parent
bbd3fd5571
commit
cbd0418704
@ -181,11 +181,10 @@ public class JSONObjectTest {
|
|||||||
|
|
||||||
// put handles objects differently than the constructor.
|
// put handles objects differently than the constructor.
|
||||||
jsonObject = new JSONObject();
|
jsonObject = new JSONObject();
|
||||||
jsonObject.put("myNumber", new MyNumberContainer());
|
jsonObject.put("myNumber", new MyNumber());
|
||||||
actual = jsonObject.toString();
|
actual = jsonObject.toString();
|
||||||
// the output is the toString of the container. i.e org.json.junit.MyNumberContainer@4f063c0a
|
// the output is the toString of the number as a string.
|
||||||
// the hex is the memory address which will change each run.
|
expected = "{\"myNumber\":\"42\"}";
|
||||||
expected = "{\"myNumber\":\""+jsonObject.get("myNumber")+"\"}";
|
|
||||||
assertEquals("Not Equal", expected , actual);
|
assertEquals("Not Equal", expected , actual);
|
||||||
|
|
||||||
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new AtomicInteger(42)));
|
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new AtomicInteger(42)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user