mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 11:25:30 -04:00
remove JSONAssert
This commit is contained in:
parent
e4aa7f1308
commit
29a7f4622d
@ -23,7 +23,6 @@ dependencies {
|
|||||||
testImplementation 'junit:junit:4.13.1'
|
testImplementation 'junit:junit:4.13.1'
|
||||||
testImplementation 'com.jayway.jsonpath:json-path:2.1.0'
|
testImplementation 'com.jayway.jsonpath:json-path:2.1.0'
|
||||||
testImplementation 'org.mockito:mockito-core:4.2.0'
|
testImplementation 'org.mockito:mockito-core:4.2.0'
|
||||||
testImplementation 'org.skyscreamer:jsonassert:1.5.1'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
7
pom.xml
7
pom.xml
@ -72,13 +72,6 @@
|
|||||||
<version>4.2.0</version>
|
<version>4.2.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.skyscreamer/jsonassert -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.skyscreamer</groupId>
|
|
||||||
<artifactId>jsonassert</artifactId>
|
|
||||||
<version>1.5.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -762,7 +762,8 @@ public class JSONMLTest {
|
|||||||
final String xml = JSONML.toString(originalObject);
|
final String xml = JSONML.toString(originalObject);
|
||||||
final JSONObject revertedObject = JSONML.toJSONObject(xml, false);
|
final JSONObject revertedObject = JSONML.toJSONObject(xml, false);
|
||||||
final String newJson = revertedObject.toString();
|
final String newJson = revertedObject.toString();
|
||||||
assertTrue("original JSON does not equal the new JSON", originalObject.similar(revertedObject));
|
assertTrue("JSON Objects are not similar", originalObject.similar(revertedObject));
|
||||||
|
assertTrue("JSON Strings are not similar", new JSONObject(originalJson).similar(new JSONObject(newJson)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// these tests do not pass for the following reasons:
|
// these tests do not pass for the following reasons:
|
||||||
|
@ -57,7 +57,6 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import com.jayway.jsonpath.Configuration;
|
import com.jayway.jsonpath.Configuration;
|
||||||
import com.jayway.jsonpath.JsonPath;
|
import com.jayway.jsonpath.JsonPath;
|
||||||
import org.skyscreamer.jsonassert.JSONAssert;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSONObject, along with JSONArray, are the central classes of the reference app.
|
* JSONObject, along with JSONArray, are the central classes of the reference app.
|
||||||
@ -2026,8 +2025,10 @@ public class JSONObjectTest {
|
|||||||
"\"key3\":\"val3\""+
|
"\"key3\":\"val3\""+
|
||||||
"}";
|
"}";
|
||||||
JSONObject jsonObject = new JSONObject(jsonObjectStr);
|
JSONObject jsonObject = new JSONObject(jsonObjectStr);
|
||||||
JSONAssert.assertEquals("jsonObject valueToString() incorrect",
|
assertTrue("jsonObject valueToString() incorrect",
|
||||||
JSONObject.valueToString(jsonObject), jsonObject.toString(), false);
|
new JSONObject(JSONObject.valueToString(jsonObject))
|
||||||
|
.similar(new JSONObject(jsonObject.toString()))
|
||||||
|
);
|
||||||
String jsonArrayStr =
|
String jsonArrayStr =
|
||||||
"[1,2,3]";
|
"[1,2,3]";
|
||||||
JSONArray jsonArray = new JSONArray(jsonArrayStr);
|
JSONArray jsonArray = new JSONArray(jsonArrayStr);
|
||||||
@ -2037,8 +2038,9 @@ public class JSONObjectTest {
|
|||||||
map.put("key1", "val1");
|
map.put("key1", "val1");
|
||||||
map.put("key2", "val2");
|
map.put("key2", "val2");
|
||||||
map.put("key3", "val3");
|
map.put("key3", "val3");
|
||||||
JSONAssert.assertEquals("map valueToString() incorrect",
|
assertTrue("map valueToString() incorrect",
|
||||||
jsonObject.toString(), JSONObject.valueToString(map), false);
|
new JSONObject(jsonObject.toString())
|
||||||
|
.similar(new JSONObject(JSONObject.valueToString(map))));
|
||||||
Collection<Integer> collection = new ArrayList<Integer>();
|
Collection<Integer> collection = new ArrayList<Integer>();
|
||||||
collection.add(Integer.valueOf(1));
|
collection.add(Integer.valueOf(1));
|
||||||
collection.add(Integer.valueOf(2));
|
collection.add(Integer.valueOf(2));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user