public abstract class JsonMatcher<T> extends TypeSafeMatcher<T>
assertThat("{\"name\": \"person\", \"height\": 80}",
jsonStringLike("{\"height\": 80, \"name\": \"person\"}"));
| Constructor and Description |
|---|
JsonMatcher(java.util.Map<java.lang.String,java.lang.Object> expectedMap) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
describeMismatchSafely(T item,
Description mismatchDescription) |
void |
describeTo(Description description) |
static Matcher<byte[]> |
jsonBytesLike(java.util.Map<java.lang.String,java.lang.Object> fields) |
static Matcher<byte[]> |
jsonBytesLike(java.lang.String json) |
static Matcher<java.lang.String> |
jsonStringLike(java.util.Map<java.lang.String,java.lang.Object> fields) |
static Matcher<java.lang.String> |
jsonStringLike(java.lang.String json) |
protected boolean |
matchesSafely(T actual) |
protected abstract java.util.Map<java.lang.String,java.lang.Object> |
parse(T json) |
describeMismatch, matches_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toStringpublic JsonMatcher(java.util.Map<java.lang.String,java.lang.Object> expectedMap)
protected abstract java.util.Map<java.lang.String,java.lang.Object> parse(T json) throws java.io.IOException
java.io.IOExceptionpublic static Matcher<byte[]> jsonBytesLike(java.lang.String json) throws java.io.IOException
java.io.IOExceptionpublic static Matcher<byte[]> jsonBytesLike(java.util.Map<java.lang.String,java.lang.Object> fields) throws java.io.IOException
java.io.IOExceptionpublic static Matcher<java.lang.String> jsonStringLike(java.lang.String json) throws java.io.IOException
java.io.IOExceptionpublic static Matcher<java.lang.String> jsonStringLike(java.util.Map<java.lang.String,java.lang.Object> fields) throws java.io.IOException
java.io.IOExceptionprotected boolean matchesSafely(T actual)
matchesSafely in class TypeSafeMatcher<T>public void describeTo(Description description)
protected void describeMismatchSafely(T item, Description mismatchDescription)
describeMismatchSafely in class TypeSafeMatcher<T>