Skip to content

Commit cbd0418

Browse files
authored
Update JSONObjectTest.java
fixes test to be applicable
1 parent bbd3fd5 commit cbd0418

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/java/org/json/junit/JSONObjectTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ public void verifyNumberOutput(){
181181

182182
// put handles objects differently than the constructor.
183183
jsonObject = new JSONObject();
184-
jsonObject.put("myNumber", new MyNumberContainer());
184+
jsonObject.put("myNumber", new MyNumber());
185185
actual = jsonObject.toString();
186-
// the output is the toString of the container. i.e org.json.junit.MyNumberContainer@4f063c0a
187-
// the hex is the memory address which will change each run.
188-
expected = "{\"myNumber\":\""+jsonObject.get("myNumber")+"\"}";
186+
// the output is the toString of the number as a string.
187+
expected = "{\"myNumber\":\"42\"}";
189188
assertEquals("Not Equal", expected , actual);
190189

191190
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new AtomicInteger(42)));

0 commit comments

Comments
 (0)