Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.4 KB

README.md

File metadata and controls

37 lines (28 loc) · 1.4 KB

Trickl AssertJ JSON

Maven Central build_status Maintainability Test Coverage License

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