Use JSONAssert instead of Assert in JSONUtilTest (#1495)

Co-authored-by: bbelide2 <bbelide2@fa23-cs527-002.cs.illinois.edu>
pull/1499/head
Bala Sukesh 1 year ago committed by GitHub
parent 472d345285
commit 79dc8f5adc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,6 +24,8 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.junit.Assert;
import org.junit.Test;
import org.json.JSONException;
import org.skyscreamer.jsonassert.JSONAssert;
import java.util.Arrays;
import java.util.Collections;
@ -42,7 +44,11 @@ public class JSONUtilTest {
@Test
public void assertToJSONString() {
Assert.assertNull(JSONUtil.toJSONString(null));
Assert.assertEquals(EXPECTED_FOO_JSON, JSONUtil.toJSONString(EXPECTED_FOO));
try {
JSONAssert.assertEquals(EXPECTED_FOO_JSON, JSONUtil.toJSONString(EXPECTED_FOO), false);
} catch (JSONException jse) {
throw new RuntimeException(jse);
}
}
@Test

Loading…
Cancel
Save