Skip to content

Commit

Permalink
Merge pull request #62 from AdrianAcala/master
Browse files Browse the repository at this point in the history
Resolves Issue #48.
  • Loading branch information
carterpage committed Jun 27, 2016
2 parents e863ba1 + ccc44f4 commit 0abb532
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/skyscreamer/jsonassert/JSONAssert.java
Expand Up @@ -217,6 +217,12 @@ public static void assertNotEquals(String expectedStr, String actualStr, boolean
*/
public static void assertEquals(String expectedStr, String actualStr, JSONCompareMode compareMode)
throws JSONException {
if (expectedStr==actualStr) return;
if (expectedStr==null){
throw new AssertionError("Expected string is null.");
}else if (actualStr==null){
throw new AssertionError("Actual string is null.");
}
JSONCompareResult result = JSONCompare.compareJSON(expectedStr, actualStr, compareMode);
if (result.failed()) {
throw new AssertionError(result.getMessage());
Expand Down

0 comments on commit 0abb532

Please sign in to comment.