|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.test.matchers.Matchers
public abstract class Matchers
Utility class containing static methods to obtain instances of (List) Matchers.
Method Summary | ||
---|---|---|
static org.hamcrest.Matcher<?> |
andNoMore()
Matches against null or void . |
|
static
|
equalTo(T expected)
Matches against each event of the same runtime type that has all field values equal to the fields in the expected event. |
|
static
|
equalTo(T expected,
FieldFilter filter)
Matches against each event of the same runtime type that has all field values equal to the fields in the expected event. |
|
static org.hamcrest.Matcher<List<?>> |
exactSequenceOf(org.hamcrest.Matcher<?>... matchers)
Matches a List of Events if each of the given matchers matches against the event at the respective
index in the list. |
|
static org.hamcrest.Matcher<List<?>> |
listWithAllOf(org.hamcrest.Matcher<?>... matchers)
Matches a List where all the given matchers must match with at least one of the items in that list. |
|
static org.hamcrest.Matcher<List<?>> |
listWithAnyOf(org.hamcrest.Matcher<?>... matchers)
Matches a List of Events where at least one of the given matchers matches any of the Events in that
list. |
|
static org.hamcrest.Matcher<Message> |
messageWithPayload(org.hamcrest.Matcher<?> payloadMatcher)
Matches a single Message if the given payloadMatcher matches that message's payload. |
|
static org.hamcrest.Matcher<List<?>> |
noCommands()
Matches an empty List of Commands. |
|
static org.hamcrest.Matcher<List<?>> |
noEvents()
Matches an empty List of Events. |
|
static org.hamcrest.Matcher<?> |
nothing()
Matches against null or void . |
|
static org.hamcrest.Matcher<List<? extends Message<?>>> |
payloadsMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
Matches a list of Messages if a list containing their respective payloads matches the given matcher . |
|
static org.hamcrest.Matcher<List<?>> |
sequenceOf(org.hamcrest.Matcher<?>... matchers)
Matches a list of Events if each of the matchers match against an Event that comes after the Event
that the previous matcher matched against. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static org.hamcrest.Matcher<List<? extends Message<?>>> payloadsMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
matcher
.
matcher
- The mather to match against the Message payloads
public static org.hamcrest.Matcher<Message> messageWithPayload(org.hamcrest.Matcher<?> payloadMatcher)
payloadMatcher
matches that message's payload.
payloadMatcher
- The matcher to match against the Message's payload
public static org.hamcrest.Matcher<List<?>> listWithAllOf(org.hamcrest.Matcher<?>... matchers)
matchers
- the matchers that should match against one of the items in the List.
public static org.hamcrest.Matcher<List<?>> listWithAnyOf(org.hamcrest.Matcher<?>... matchers)
matchers
matches any of the Events in that
list.
matchers
- the matchers that should match against one of the items in the List of Events.
public static org.hamcrest.Matcher<List<?>> sequenceOf(org.hamcrest.Matcher<?>... matchers)
matchers
match against an Event that comes after the Event
that the previous matcher matched against. This means that the given matchers
must match in order,
but there may be "gaps" of unmatched events in between.
To match the exact sequence of events (i.e. without gaps), use exactSequenceOf(org.hamcrest.Matcher[])
.
matchers
- the matchers to match against the list of events
public static org.hamcrest.Matcher<List<?>> exactSequenceOf(org.hamcrest.Matcher<?>... matchers)
matchers
matches against the event at the respective
index in the list. This means the first matcher must match the first event, the second matcher the second event,
and so on.
Any excess Events are ignored. If there are excess Matchers, they will be evaluated against null
.
To
make sure the number of Events matches the number of Matchers, you can append an extra andNoMore()
matcher.
To allow "gaps" of unmatched Events, use sequenceOf(org.hamcrest.Matcher[])
instead.
matchers
- the matchers to match against the list of events
public static org.hamcrest.Matcher<List<?>> noEvents()
public static org.hamcrest.Matcher<List<?>> noCommands()
public static <T> EqualFieldsMatcher<T> equalTo(T expected)
T
- The type of event to match againstexpected
- The event with the expected field values
public static <T> EqualFieldsMatcher<T> equalTo(T expected, FieldFilter filter)
T
- The type of event to match againstexpected
- The event with the expected field valuesfilter
- The filter describing the Fields to include in the comparison
public static org.hamcrest.Matcher<?> andNoMore()
null
or void
. Can be used to make sure no trailing events remain when
using an Exact Sequence Matcher (exactSequenceOf(org.hamcrest.Matcher[])
).
public static org.hamcrest.Matcher<?> nothing()
null
or void
. Can be used to make sure no trailing events remain when
using an Exact Sequence Matcher (exactSequenceOf(org.hamcrest.Matcher[])
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |