a Skyscreamer project

Quick Start

To use, download and build the JAR or add the following to your project's pom.xml:


Syntax is simple, and similar to JUnit Assert:

JSONAssert.assertEquals(expectedJSON, actualJSON, strictMode);

Add JSONassert tests within existing JUnit tests, just like you would add a standard Assert:

public void testGetUser() {
  String result = _restService.get("/user/123.json");
  JSONAssert.assertEquals("{id:123,name:\"Joe\"}", result, false);

It is recommended that you leave strictMode off, so your tests will be less brittle. Turn it on if you need to enforce a particular order for arrays, or if you want to ensure that the actual JSON does not have any fields beyond what's expected.