|
|
@ -987,20 +987,36 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
|
|
|
|
if (this.actual == null) {
|
|
|
|
if (this.actual == null) {
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
this.actual.toString(), compareMode);
|
|
|
|
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,
|
|
|
|
JSONComparator comparator) {
|
|
|
|
JSONComparator comparator) {
|
|
|
|
if (this.actual == null) {
|
|
|
|
if (this.actual == null) {
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
return compareForNull(expectedJson);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
return JSONCompare.compareJSON(
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
(expectedJson == null ? null : expectedJson.toString()),
|
|
|
|
this.actual.toString(), comparator);
|
|
|
|
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) {
|
|
|
|
JSONCompareResult result = new JSONCompareResult();
|
|
|
|
JSONCompareResult result = new JSONCompareResult();
|
|
|
|