mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 19:35:31 -04:00
fix: flakiness in JSONMLTest#testToJSONObject_reversibility
This commit is contained in:
parent
01727fd0ed
commit
becc1631e6
@ -23,6 +23,7 @@ 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,6 +72,13 @@
|
|||||||
<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>
|
||||||
|
@ -8,6 +8,7 @@ import static org.junit.Assert.*;
|
|||||||
|
|
||||||
import org.json.*;
|
import org.json.*;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.skyscreamer.jsonassert.JSONAssert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for org.json.JSONML.java
|
* Tests for org.json.JSONML.java
|
||||||
@ -763,7 +764,7 @@ public class JSONMLTest {
|
|||||||
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("JSON Objects are not similar",originalObject.similar(revertedObject));
|
assertTrue("JSON Objects are not similar",originalObject.similar(revertedObject));
|
||||||
assertEquals("original JSON does not equal the new JSON",originalJson, newJson);
|
JSONAssert.assertEquals("original JSON does not equal the new JSON", originalJson, newJson, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// these tests do not pass for the following reasons:
|
// these tests do not pass for the following reasons:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user