java.lang.Object | |||
↳ | org.hamcrest.BaseMatcher<T> | ||
↳ | org.hamcrest.TypeSafeDiagnosingMatcher<T> | ||
↳ | uk.co.datumedge.hamcrest.json.SameJSONAs<T> |
Matcher that asserts that one JSON document is the same as another.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a matcher that allows any element ordering within JSON arrays.
| |||||||||||
Creates a matcher that allows fields not present in the expected JSON document.
| |||||||||||
Creates a matcher that compares
JSONArray s. | |||||||||||
Creates a matcher that compares JSONObjects or JSONArrays.
| |||||||||||
Creates a matcher that compares
JSONObject s. | |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates a matcher that allows any element ordering within JSON arrays. For example,
{"fib":[0,1,1,2,3]}
will match {"fib":[3,1,0,2,1]}
.
Creates a matcher that allows fields not present in the expected JSON document. For example, if the expected document is
{ "name" : "John Smith", "address" : { "street" : "29 Acacia Road" } }then the following document will match:
{ "name" : "John Smith", "age" : 34, "address" : { "street" : "29 Acacia Road", "city" : "Huddersfield" } }All array elements must exist in both documents, so the expected document
[ { "name" : "John Smith" } ]will not match the actual document
[ { "name" : "John Smith" }, { "name" : "Bob Jones" } ]
Creates a matcher that compares JSONArray
s.
expected | the expected JSONArray instance |
---|
Matcher
instance
Creates a matcher that compares JSONObjects or JSONArrays.
expected | the expected JSON document |
---|
Matcher
instance
Creates a matcher that compares JSONObject
s.
expected | the expected JSONObject instance |
---|
Matcher
instance