Skip to content

Commit 114e7c5

Browse files
committed
Nest objects to see path in diagnostics
1 parent 4e79823 commit 114e7c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/org/skyscreamer/jsonassert/JSONCompareTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public void reportsUnexpectedNonNull() throws JSONException {
6666

6767
@Test
6868
public void reportsUnexpectedFieldInNonExtensibleMode() throws JSONException {
69-
JSONCompareResult result = compareJSON("{}", "{\"id\": 3}", NON_EXTENSIBLE);
70-
assertThat(result, failsWithMessage(equalTo("Strict checking failed. Got but did not expect: id")));
69+
JSONCompareResult result = compareJSON("{\"obj\": {}}", "{\"obj\": {\"id\": 3}}", NON_EXTENSIBLE);
70+
assertThat(result, failsWithMessage(equalTo("Strict checking failed. Got but did not expect: obj.id")));
7171
}
7272

7373
@Test

0 commit comments

Comments
 (0)