Package org.mockito.internal.invocation
Class MatcherApplicationStrategy
java.lang.Object
org.mockito.internal.invocation.MatcherApplicationStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Invocation
private final List
<? extends ArgumentMatcher<?>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MatcherApplicationStrategy
(Invocation invocation, List<? extends ArgumentMatcher<?>> matchers) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
argsMatch
(Object[] arguments, List<? extends ArgumentMatcher<?>> matchers, ArgumentMatcherAction action) boolean
Applies the givenArgumentMatcherAction
to all arguments and corresponding matchersstatic MatcherApplicationStrategy
getMatcherApplicationStrategyFor
(Invocation invocation, List<? extends ArgumentMatcher<?>> matchers) Returns theMatcherApplicationStrategy
that must be used to capture the arguments of the given invocation using the given matchers.private Class
<?> private Class
<?>
-
Field Details
-
invocation
-
matchers
-
-
Constructor Details
-
MatcherApplicationStrategy
private MatcherApplicationStrategy(Invocation invocation, List<? extends ArgumentMatcher<?>> matchers)
-
-
Method Details
-
getMatcherApplicationStrategyFor
public static MatcherApplicationStrategy getMatcherApplicationStrategyFor(Invocation invocation, List<? extends ArgumentMatcher<?>> matchers) Returns theMatcherApplicationStrategy
that must be used to capture the arguments of the given invocation using the given matchers.- Parameters:
invocation
- that contain the arguments to capturematchers
- that will be used to capture the arguments of the invocation, the passedList
is not required to contain aCapturingMatcher
- Returns:
- never
null
-
forEachMatcherAndArgument
Applies the givenArgumentMatcherAction
to all arguments and corresponding matchers- Parameters:
action
- must not benull
- Returns:
true
if the given action returnedtrue
for all arguments and matchers passed to it.false
if the given action returnedfalse
for one of the passed arguments and matchersfalse
if the given matchers don't fit to the given invocation because too many or to few matchers are available.
-
argsMatch
private boolean argsMatch(Object[] arguments, List<? extends ArgumentMatcher<?>> matchers, ArgumentMatcherAction action) -
lastMatcherType
-
lastParameterType
-