org.mockito.invocation
public interface MatchableInvocation extends DescribedInvocation
MatchableInvocation
wraps Invocation
instance
and holds argument matchers associated with that invocation.
It is used during verification process:
mock.foo(); // <- invocation
verify(mock).bar(); // <- matchable invocation
Modifier and Type | Method and Description |
---|---|
void |
captureArgumentsFrom(Invocation invocation)
This method is used by Mockito to implement argument captor functionality (see
ArgumentCaptor . |
Invocation |
getInvocation()
The actual invocation Mockito will match against.
|
List<ArgumentMatcher> |
getMatchers()
The argument matchers of this invocation.
|
boolean |
hasSameMethod(Invocation candidate)
Returns true if the candidate invocation has the same method (method name and parameter types)
|
boolean |
hasSimilarMethod(Invocation candidate)
Candidate invocation has the similar method.
|
boolean |
matches(Invocation candidate)
Same method, mock and all arguments match.
|
getLocation, toString
Invocation getInvocation()
List<ArgumentMatcher> getMatchers()
ArgumentMatcher
instances
that use 'eq' matching via ArgumentMatchers.eq(Object)
.boolean matches(Invocation candidate)
boolean hasSimilarMethod(Invocation candidate)
boolean hasSameMethod(Invocation candidate)
void captureArgumentsFrom(Invocation invocation)
ArgumentCaptor
.
Makes this instance of matchable invocation capture all arguments of provided invocation.
invocation
- the invocation to capture the arguments from