|
|
@ -987,9 +987,17 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
|
|
|
|
if (this.actual == null) {
|
|
|
|
if (this.actual == null) {
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
try {
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
this.actual.toString(), compareMode);
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
|
|
|
|
this.actual.toString(), compareMode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex) {
|
|
|
|
|
|
|
|
if (ex instanceof RuntimeException) {
|
|
|
|
|
|
|
|
throw (RuntimeException) ex;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new IllegalStateException(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private JSONCompareResult compare(CharSequence expectedJson,
|
|
|
|
private JSONCompareResult compare(CharSequence expectedJson,
|
|
|
@ -997,9 +1005,17 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
|
|
|
|
if (this.actual == null) {
|
|
|
|
if (this.actual == null) {
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
try {
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
this.actual.toString(), comparator);
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
|
|
|
|
this.actual.toString(), comparator);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex) {
|
|
|
|
|
|
|
|
if (ex instanceof RuntimeException) {
|
|
|
|
|
|
|
|
throw (RuntimeException) ex;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new IllegalStateException(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private JSONCompareResult compareForNull(CharSequence expectedJson) {
|
|
|
|
private JSONCompareResult compareForNull(CharSequence expectedJson) {
|
|
|
|