() {
+ @Override
+ public void describeTo(Description description) {
+ description.appendText("a failed comparison with message ").appendDescriptionOf(expectedMessage);
+ }
+
+ @Override
+ public boolean matchesSafely(JSONCompareResult item) {
+ return item.failed() && expectedMessage.matches(item.getMessage());
+ }
+ };
+ }
+}
From 574b72a0d65d07462f5036821947c119a677a116 Mon Sep 17 00:00:00 2001
From: LightingTom <59653302+LightingTom@users.noreply.github.com>
Date: Mon, 17 May 2021 12:29:41 +0800
Subject: [PATCH 7/8] Fix some bugs
---
src/main/java/org/skyscreamer/jsonassert/JSONAssert.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java b/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java
index 199a89e1..3fe9c9e8 100644
--- a/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java
+++ b/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java
@@ -18,6 +18,7 @@
import org.json.JSONException;
import org.json.JSONObject;
import org.skyscreamer.jsonassert.comparator.JSONComparator;
+import java.util.ArrayList;
/**
* A set of assertion methods useful for writing tests methods that return JSON.
From 0f6621ff1588d14c94ca36add6a066c60a1e2fcc Mon Sep 17 00:00:00 2001
From: LightingTom <59653302+LightingTom@users.noreply.github.com>
Date: Mon, 17 May 2021 12:30:07 +0800
Subject: [PATCH 8/8] Fix some bugs
---
src/main/java/org/skyscreamer/jsonassert/JSONCompare.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java b/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
index e968ef63..8c28d3e0 100644
--- a/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
+++ b/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
@@ -20,6 +20,8 @@
import org.json.JSONString;
import org.skyscreamer.jsonassert.comparator.DefaultComparator;
import org.skyscreamer.jsonassert.comparator.JSONComparator;
+import java.util.ArrayList;
+import java.util.Iterator;
/**
* Provides API to compare two JSON entities. This is the backend to {@link JSONAssert}, but it can