org.axonframework.test.matchers
Class ListWithAnyOfMatcher

java.lang.Object
  extended by org.hamcrest.BaseMatcher<List<?>>
      extended by org.axonframework.test.matchers.ListMatcher
          extended by org.axonframework.test.matchers.ListWithAnyOfMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<List<?>>, org.hamcrest.SelfDescribing

public class ListWithAnyOfMatcher
extends ListMatcher

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
ListWithAnyOfMatcher(org.hamcrest.Matcher... matchers)
          Construct a matcher that will return true if any of the given matchers matches against at least one item in a given List.
 
Method Summary
protected  void describeCollectionType(org.hamcrest.Description description)
          Describes the type of collection expected.
protected  String failedMatcherMessage()
          The message to append behind a failing matcher.
protected  String getLastSeparator()
          The separator to use between the two last events.
 boolean matchesList(List<?> items)
          Evaluates the matcher for argument item.
 
Methods inherited from class org.axonframework.test.matchers.ListMatcher
describeTo, getMatchers, matches, matchRemainder, reportFailed
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListWithAnyOfMatcher

public ListWithAnyOfMatcher(org.hamcrest.Matcher... matchers)
Construct a matcher that will return true if any of the given matchers matches 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 Detail

matchesList

public boolean matchesList(List<?> items)
Description copied from class: ListMatcher
Evaluates the matcher for argument item. 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:
matchesList in class ListMatcher
Parameters:
items - the object against which the matcher is evaluated.
Returns:
true if item matches, otherwise false.
See Also:
BaseMatcher

describeCollectionType

protected void describeCollectionType(org.hamcrest.Description description)
Description copied from class: ListMatcher
Describes the type of collection expected. To be used in the sentence: "list with ... of: ". E.g. "all" or "sequence".

Specified by:
describeCollectionType in class ListMatcher
Parameters:
description - the description to append the collection type to

failedMatcherMessage

protected String failedMatcherMessage()
Description copied from class: ListMatcher
The message to append behind a failing matcher. Defaults to FAILED!.

Overrides:
failedMatcherMessage in class ListMatcher
Returns:
The message to append behind a failing matcher

getLastSeparator

protected String getLastSeparator()
Description copied from class: ListMatcher
The separator to use between the two last events. Defaults to "and".

Overrides:
getLastSeparator in class ListMatcher
Returns:
The separator to use between the two last events. Defaults to "and".


Copyright © 2010-2016. All Rights Reserved.