Class CoreJsonAssertion<T,A extends CoreJsonAssertion<T,A>>
java.lang.Object
org.hamcrest.BaseMatcher<T>
uk.org.webcompere.modelassert.json.impl.CoreJsonAssertion<T,A>
- Type Parameters:
T- the type of JSON source - e.g. String or FileA- the type of the assertion subclass, into which the fluent methods castthis
- All Implemented Interfaces:
org.hamcrest.Matcher<T>,org.hamcrest.SelfDescribing,JsonNodeAssertDsl<A>,ArrayNodeDsl<A>,BooleanNodeDsl<A>,NumberComparisonDsl<A>,NumberNodeDsl<A>,ObjectNodeDsl<A>,Sizeable<A>,TextNodeDsl<A>,IsEqualToDsl<A>,TreeComparisonDsl<A>,Satisfies<A>
- Direct Known Subclasses:
AssertJson,HamcrestJsonAssertion
public abstract class CoreJsonAssertion<T,A extends CoreJsonAssertion<T,A>>
extends org.hamcrest.BaseMatcher<T>
implements JsonNodeAssertDsl<A>, Satisfies<A>
Common implementation of both variants of the json assertion. Is itself a
BaseMatcher as
the implementation has to work hardest to be compatible with hamcrest-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddescribeMismatch(Object item, org.hamcrest.Description description) voiddescribeTo(org.hamcrest.Description description) booleanAdd a condition that the input JSON must satisfyorg.mockito.ArgumentMatcher<T>Convert this to a mockito argument matcher in order to test JSON sent through to a method or provide responses based on JSONMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.ArrayNodeDsl
isArray, isArrayContaining, isArrayContaining, isArrayContainingExactly, isArrayContainingExactly, isArrayContainingExactlyInAnyOrder, isArrayContainingExactlyInAnyOrder, isNotArray, satisfiesArrayConditionMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.BooleanNodeDsl
isBoolean, isFalse, isNotBoolean, isTrueMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.tree.IsEqualToDsl
isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualToYaml, isEqualToYaml, isEqualToYaml, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualToYaml, isNotEqualToYaml, isNotEqualToYamlMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.JsonNodeAssertDsl
array, at, booleanNode, hasValue, is, is, isAnyNode, isMissing, isNot, isNotEmpty, isNotMissing, isNotNull, isNull, matches, number, object, textMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.NumberComparisonDsl
isBetween, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, isZero, satisfiesNumberConditionMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.NumberNodeDsl
isDouble, isGreaterThanDouble, isGreaterThanInt, isGreaterThanLong, isGreaterThanOrEqualToDouble, isGreaterThanOrEqualToInt, isGreaterThanOrEqualToLong, isInteger, isLessThanDouble, isLessThanInt, isLessThanLong, isLessThanOrEqualToDouble, isLessThanOrEqualToInt, isLessThanOrEqualToLong, isLong, isNotNumber, isNumber, isNumberEqualTo, isNumberNotEqualToMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.ObjectNodeDsl
containsKey, containsKeys, containsKeysExactly, containsKeysExactlyInAnyOrder, doesNotContainKey, doesNotContainKeys, isNotObject, isObject, satisfiesObjectConditionMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.Sizeable
hasSize, isEmpty, sizeMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.TextNodeDsl
isEmptyText, isNotEmptyText, isNotText, isNotText, isText, isText, matches, matches, satisfiesTextCondition, textContains, textDoesNotContain, textDoesNotStartWith, textMatches, textStartsWithMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.TreeComparisonDsl
isEqualTo, isNotEqualTo, where
-
Constructor Details
-
CoreJsonAssertion
-
-
Method Details
-
satisfies
Description copied from interface:SatisfiesAdd a condition that the input JSON must satisfy -
matches
- Specified by:
matchesin interfaceorg.hamcrest.Matcher<T>
-
describeTo
public void describeTo(org.hamcrest.Description description) - Specified by:
describeToin interfaceorg.hamcrest.SelfDescribing
-
describeMismatch
-
toArgumentMatcher
Convert this to a mockito argument matcher in order to test JSON sent through to a method or provide responses based on JSON- Returns:
- this as an argument matcher
-