Trickl AssertJ JSON
An AssertJ fluent assertion wrapper around the Skyscreamer JSON comparison library
Installation
To install from Maven Central:
<dependency>
<groupId>com.github.trickl</groupId>
<artifactId>assertj-json</artifactId>
<version>0.2.8</version>
</dependency>
Example
assertThat(json("{\"age\":43, \"friend_ids\":[16, 23, 52]}"))
.allowingExtraUnexpectedFields()
.allowingAnyArrayOrdering()
.isSameJsonAs("{\"friend_ids\":[52, 23, 16]}");
Acknowledgments
AssertJ - http://joel-costigliola.github.io/assertj/
Skyscreamer JSON Library - https://github.com/skyscreamer/JSONassert