diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5172429 Binary files /dev/null and b/.DS_Store differ diff --git a/pom.xml b/pom.xml index 7836aaa..8c17f68 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,11 @@ + + org.skyscreamer + jsonassert + 1.5.0 + com.squareup.okhttp3 okhttp diff --git a/src/test/java/JsonTest.java b/src/test/java/JsonTest.java index 6c3811b..f5d46bb 100644 --- a/src/test/java/JsonTest.java +++ b/src/test/java/JsonTest.java @@ -1,7 +1,8 @@ import com.sankuai.groupmeal.base.util.JsonUtil; import com.sankuai.groupmeal.business.pay.PayCallbackParam; -import org.junit.Assert; import org.junit.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.json.JSONException; /** * @author zhengxiaoluo @@ -26,6 +27,10 @@ public void payCallBackParam() { PayCallbackParam param1 = JsonUtil.decode2Camel(json, PayCallbackParam.class); String json1 = JsonUtil.encode2UnderScore(param1); System.out.println(json1); - Assert.assertTrue(json.equals(json1)); + try { + JSONAssert.assertEquals(json, json1, false); + } catch (JSONException e) { + throw new IllegalArgumentException(e.getMessage()); + } } }