public interface ExtendedMatchers extends MatchersMixin
| Modifier and Type | Method and Description |
|---|---|
default <T> List<T> |
allListItemsMatch(Predicate<T> predicate)
A predicate-based matcher for list arguments - all items must match
|
default <T> Set<T> |
allSetItemsMatch(Predicate<T> predicate)
A predicate-based matcher for set arguments - all items must match
|
default byte |
byteMatches(Predicate<Byte> predicate)
A predicate-based matcher for primitive byte arguments
|
default byte |
byteMatches(Predicate<Byte> predicate,
String description)
A predicate-based matcher for primitive byte arguments
|
default char |
charMatches(Predicate<Character> predicate)
A predicate-based matcher for primitive char arguments
|
default char |
charMatches(Predicate<Character> predicate,
String description)
A predicate-based matcher for primitive char arguments
|
default String |
containsAllOf(CharSequence... expectedParts)
A matcher call which matches if an argument contains all the given text
|
default String |
containsOneOrMoreOf(CharSequence... expectedParts)
A matcher call which matches if an argument contains at least one of the
given text parts
|
default double |
doubleMatches(Predicate<Double> predicate)
A predicate-based matcher for primitive double arguments
|
default double |
doubleMatches(Predicate<Double> predicate,
String description)
A predicate-based matcher for primitive double arguments
|
default float |
floatMatches(Predicate<Float> predicate)
A predicate-based matcher for primitive float arguments
|
default float |
floatMatches(Predicate<Float> predicate,
String description)
A predicate-based matcher for primitive float arguments
|
default <T> T |
hasToString(String expectedToString)
Match based on exact toString() of the argument
|
default int |
intMatches(Predicate<Integer> predicate)
A predicate-based matcher for primitive int arguments
|
default int |
intMatches(Predicate<Integer> predicate,
String description)
A predicate-based matcher for primitive int arguments
|
default <T> List<T> |
listContainsExactlyInAnyOrder(T... items)
Lenient-order list matcher For a match, the list argument encountered by
the mock must contain exactly the items provided (no more, no fewer), but
any order is acceptable
|
default long |
longMatches(Predicate<Long> predicate)
A predicate-based matcher for primitive long arguments
|
default long |
longMatches(Predicate<Long> predicate,
String description)
A predicate-based matcher for primitive long arguments
|
default <K,V> Map<K,V> |
mapThat(Predicate<Map<K,V>> predicate)
Matcher for a map argument
|
default <K,V> Map<K,V> |
mapThat(Predicate<Map<K,V>> predicate,
String description)
Matcher for a map argument
|
default <T> T |
objectMatches(Predicate<T> predicate)
A predicate-based matcher for object arguments
Effectively, it's equivalent to argThat(), but objectMatches can accept a
Predicate instance which can be reused in a variable outside of Mockito,
whereas argThat can accept as its argument a lambda, but not a Predicate.
|
default <T> T |
objectMatches(Predicate<T> predicate,
String description)
A predicate-based matcher for object arguments
Effectively, it's equivalent to argThat(), but objectMatches can accept a
Predicate instance which can be reused in a variable outside of Mockito,
whereas argThat can accept as its argument a lambda, but not a Predicate.
|
default <T> List<T> |
oneOrMoreListItemsMatch(Predicate<T> predicate)
A predicate-based matcher for list arguments - at least one item must
match
|
default <T> Set<T> |
oneOrMoreSetItemsMatch(Predicate<T> predicate)
A predicate-based matcher for set arguments - at least one of the items
must match
|
default short |
shortMatches(Predicate<Short> predicate)
A predicate-based matcher for primitive short arguments
|
default short |
shortMatches(Predicate<Short> predicate,
String description)
A predicate-based matcher for primitive short arguments
|
default <T> T |
toStringContainsAllOf(CharSequence... expectedParts)
A matcher call which matches if an argument's toString() result contains
all of the given text
|
default <T> T |
toStringContainsOneOrMoreOf(CharSequence... expectedParts)
A matcher call which matches if an argument's toString() result contains
at least one of the given text
|
any, any, anyBoolean, anyByte, anyChar, anyCollection, anyCollectionOf, anyDouble, anyFloat, anyInt, anyIterable, anyIterableOf, anyList, anyListOf, anyLong, anyMap, anyMapOf, anyObject, anySet, anySetOf, anyShort, anyString, anyVararg, argThat, booleanThat, byteThat, charThat, contains, doubleThat, endsWith, eq, eq, eq, eq, eq, eq, eq, eq, eq, floatThat, intThat, isA, isNotNull, isNotNull, isNull, isNull, longThat, matches, matches, notNull, notNull, nullable, refEq, same, shortThat, startsWithdefault String containsAllOf(CharSequence... expectedParts)
expectedParts - default <T> T toStringContainsAllOf(CharSequence... expectedParts)
expectedParts - default String containsOneOrMoreOf(CharSequence... expectedParts)
expectedParts - default <T> T toStringContainsOneOrMoreOf(CharSequence... expectedParts)
expectedParts - default <T> List<T> allListItemsMatch(Predicate<T> predicate)
predicate - default <T> List<T> oneOrMoreListItemsMatch(Predicate<T> predicate)
predicate - A lambda to evaluate a method argumentdefault <T> List<T> listContainsExactlyInAnyOrder(T... items)
items - List of exact items expected (in any order)default <K,V> Map<K,V> mapThat(Predicate<Map<K,V>> predicate)
predicate - lambda for assessing the map argumentdefault <K,V> Map<K,V> mapThat(Predicate<Map<K,V>> predicate, String description)
predicate - lambda for assessing the map argumentdescription - Description of expected argument - will appear in verify()
failuresdefault <T> Set<T> allSetItemsMatch(Predicate<T> predicate)
predicate - default <T> Set<T> oneOrMoreSetItemsMatch(Predicate<T> predicate)
predicate - default <T> T objectMatches(Predicate<T> predicate)
predicate - A lambda to evaluate a method argumentdefault <T> T objectMatches(Predicate<T> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Will appear in verify() failure messagesdefault int intMatches(Predicate<Integer> predicate)
predicate - A lambda to evaluate a method argumentdefault int intMatches(Predicate<Integer> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Description of expected argument - will appear in verify()
failuresdefault double doubleMatches(Predicate<Double> predicate)
predicate - A lambda to evaluate a method argumentdefault double doubleMatches(Predicate<Double> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Description of expected argument - will appear in verify()
failuresdefault float floatMatches(Predicate<Float> predicate)
predicate - A lambda to evaluate a method argumentdefault float floatMatches(Predicate<Float> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Description of expected argument - will appear in verify()
failuresdefault short shortMatches(Predicate<Short> predicate)
predicate - A lambda to evaluate a method argumentdefault short shortMatches(Predicate<Short> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Description of expected argument - will appear in verify()
failuresdefault long longMatches(Predicate<Long> predicate)
predicate - A lambda to evaluate a method argumentdefault long longMatches(Predicate<Long> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Description of expected argument - will appear in verify()
failuresdefault byte byteMatches(Predicate<Byte> predicate)
predicate - A lambda to evaluate a method argumentdefault byte byteMatches(Predicate<Byte> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Description of expected argument - will appear in verify()
failuresdefault char charMatches(Predicate<Character> predicate)
predicate - A lambda to evaluate a method argumentdefault char charMatches(Predicate<Character> predicate, String description)
predicate - A lambda to evaluate a method argumentdescription - Description of expected argument - will appear in verify()
failuresdefault <T> T hasToString(String expectedToString)
expectedToString - Copyright © 2017. All rights reserved.