Package org.elasticsearch.test
Class ListMatcher
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<List<?>>
org.elasticsearch.test.ListMatcher
- All Implemented Interfaces:
org.hamcrest.Matcher<List<?>>
,org.hamcrest.SelfDescribing
Matcher for
Lists
that reports all errors at once.-
Method Summary
Modifier and TypeMethodDescriptionprotected void
describeMismatchSafely
(List<?> item, org.hamcrest.Description description) Expect a value.item
(org.hamcrest.Matcher<?> valueMatcher) Expect aMatcher
.static ListMatcher
Create a ListMatcher that matches empty lists.static ListMatcher
matchesList
(List<?> list) Create a ListMatcher that matches a list.protected boolean
matchesSafely
(List<?> item) Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matches
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
Method Details
-
matchesList
Create a ListMatcher that matches empty lists. -
matchesList
Create a ListMatcher that matches a list. -
item
Expect a value.Passing a
Matcher
to this method will function as though you passed it directly toitem(Matcher)
.- Returns:
- a new
ListMatcher
that expects all items this matcher expected followed by the provided item
-
item
Expect aMatcher
.- Returns:
- a new
ListMatcher
that expects all items this matcher expected followed by the provided item
-
matchesSafely
- Specified by:
matchesSafely
in classorg.hamcrest.TypeSafeMatcher<List<?>>
-
describeMismatchSafely
- Overrides:
describeMismatchSafely
in classorg.hamcrest.TypeSafeMatcher<List<?>>
-