You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing equality assertions, JSONAssert considers quoted an unquoted strings to be equal. So for example assertEquals("abc", ""abc"") would pass. Unquoted strings should either be throw an error for invalid json, or at the very least fail equality when compared against a quoted string.
Example code:
@Test
public void testJsonString()
{
String expected = "{ \"value\": \"abc\"}";
String actual = "{\"value\": abc}";
System.out.println(expected);
System.out.println(actual);
//this assertion should fail but it will pass
JSONAssert.assertEquals( expected, actual, true);
}
The text was updated successfully, but these errors were encountered:
When doing equality assertions, JSONAssert considers quoted an unquoted strings to be equal. So for example assertEquals("abc", ""abc"") would pass. Unquoted strings should either be throw an error for invalid json, or at the very least fail equality when compared against a quoted string.
Example code:
The text was updated successfully, but these errors were encountered: