Hamcrest JSON

Hamcrest JSON matchers

License

License

Categories

Categories

JSON Data
GroupId

GroupId

uk.co.datumedge
ArtifactId

ArtifactId

hamcrest-json
Last Version

Last Version

0.2
Release Date

Release Date

Type

Type

jar
Description

Description

Hamcrest JSON
Hamcrest JSON matchers
Project URL

Project URL

https://github.com/hertzsprung/hamcrest-json
Source Code Management

Source Code Management

http://github.com/hertzsprung/hamcrest-json

Download hamcrest-json

How to add to project

<!-- https://jarcasting.com/artifacts/uk.co.datumedge/hamcrest-json/ -->
<dependency>
    <groupId>uk.co.datumedge</groupId>
    <artifactId>hamcrest-json</artifactId>
    <version>0.2</version>
</dependency>
// https://jarcasting.com/artifacts/uk.co.datumedge/hamcrest-json/
implementation 'uk.co.datumedge:hamcrest-json:0.2'
// https://jarcasting.com/artifacts/uk.co.datumedge/hamcrest-json/
implementation ("uk.co.datumedge:hamcrest-json:0.2")
'uk.co.datumedge:hamcrest-json:jar:0.2'
<dependency org="uk.co.datumedge" name="hamcrest-json" rev="0.2">
  <artifact name="hamcrest-json" type="jar" />
</dependency>
@Grapes(
@Grab(group='uk.co.datumedge', module='hamcrest-json', version='0.2')
)
libraryDependencies += "uk.co.datumedge" % "hamcrest-json" % "0.2"
[uk.co.datumedge/hamcrest-json "0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.skyscreamer : jsonassert jar 1.1.1
org.hamcrest : hamcrest-core jar 1.3

test (3)

Group / Artifact Type Version
org.hamcrest : hamcrest-library jar 1.3
org.jmock : jmock-junit4 jar 2.6.0-RC2
junit : junit jar 4.10

Project Modules

There are no modules declared in this project.

Hamcrest matchers for comparing JSON documents, backed by the JSONassert library. The code is released under the MIT license.

Installation

To install from Maven Central:

<dependency>
	<groupId>uk.co.datumedge</groupId>
	<artifactId>hamcrest-json</artifactId>
	<version>0.1</version>
</dependency>

Usage

assertThat(
	"{\"age\":43, \"friend_ids\":[16, 52, 23]}",
	sameJSONAs("{\"friend_ids\":[52, 23, 16]}")
		.allowingExtraUnexpectedFields()
		.allowingAnyArrayOrdering());

Resources

Versions

Version
0.2
0.1