Skip to content

Commit

Permalink
Use JSONAssert instead of Assert in JSONUtilTest (opengoofy#1495)
Browse files Browse the repository at this point in the history
Co-authored-by: bbelide2 <[email protected]>
  • Loading branch information
bbelide2 and bbelide2 authored Oct 6, 2023
1 parent 472d345 commit 79dc8f5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
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;
Expand All @@ -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
Expand Down

0 comments on commit 79dc8f5

Please sign in to comment.