Package org.axonframework.test.matchers
Class ListWithAnyOfMatcher<T>
java.lang.Object
org.hamcrest.BaseMatcher<List<T>>
org.axonframework.test.matchers.ListMatcher<T>
org.axonframework.test.matchers.ListWithAnyOfMatcher<T>
- All Implemented Interfaces:
org.hamcrest.Matcher<List<T>>,org.hamcrest.SelfDescribing
A matcher that will match if all the given
matchers match against at least one item in a given List.- Since:
- 1.1
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionListWithAnyOfMatcher(org.hamcrest.Matcher<T>... matchers) Construct a matcher that will return true if any of the givenmatchersmatches against at least one item in a given List. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddescribeCollectionType(org.hamcrest.Description description) Describes the type of collection expected.protected StringThe message to append behind a failing matcher.protected StringThe separator to use between the two last events.booleanmatchesList(List<T> items) Evaluates the matcher for argumentitem.Methods inherited from class org.axonframework.test.matchers.ListMatcher
describeTo, getMatchers, matches, matchRemainder, reportFailedMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString
-
Constructor Details
-
ListWithAnyOfMatcher
Construct a matcher that will return true if any of the givenmatchersmatches against at least one item in a given List.- Parameters:
matchers- The matchers that must match against at least one item in the list.
-
-
Method Details
-
matchesList
Description copied from class:ListMatcherEvaluates the matcher for argumentitem. The item has been verified to be a list, but the exact type of contents of a list cannot be verified, due to Erasure of Generic Types.- Specified by:
matchesListin classListMatcher<T>- Parameters:
items- the object against which the matcher is evaluated.- Returns:
trueifitemmatches, otherwisefalse.- See Also:
-
describeCollectionType
protected void describeCollectionType(org.hamcrest.Description description) Description copied from class:ListMatcherDescribes the type of collection expected. To be used in the sentence: "list with ... of:". E.g. "all" or "sequence". - Specified by:
describeCollectionTypein classListMatcher<T>- Parameters:
description- the description to append the collection type to
-
failedMatcherMessage
Description copied from class:ListMatcherThe message to append behind a failing matcher. Defaults to FAILED!.- Overrides:
failedMatcherMessagein classListMatcher<T>- Returns:
- The message to append behind a failing matcher
-
getLastSeparator
Description copied from class:ListMatcherThe separator to use between the two last events. Defaults to "and".- Overrides:
getLastSeparatorin classListMatcher<T>- Returns:
- The separator to use between the two last events. Defaults to "and".
-