Open Kamil-Benedykcinski opened 6 years ago
Snippet below fails:(
import org.junit.Test; import org.skyscreamer.jsonassert.JSONCompareMode; import org.skyscreamer.jsonassert.JSONCompareResult; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONCompare.compareJSON; public class JsonAssertTest { @Test public void shouldFailOnCrashedJson() { // given String validJson = "{\"id\":\"abc\"}"; String crashedJson = "{\"id\":abc}"; // when JSONCompareResult jsonCompareResult = compareJSON(validJson, crashedJson, JSONCompareMode.STRICT); // then assertThat(jsonCompareResult.failed()).isTrue(); } }
The json auto add " to the json string. If i use another lib of json like fastjson,the compare would fail.
Snippet below fails:(