Package org.mockito.invocation
Interface MatchableInvocation
-
- All Superinterfaces:
DescribedInvocation
public interface MatchableInvocation extends DescribedInvocation
MatchableInvocation
wrapsInvocation
instance and holds argument matchers associated with that invocation. It is used during verification process:mock.foo(); // <- invocation verify(mock).bar(); // <- matchable invocation
- Since:
- 2.2.12
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
captureArgumentsFrom(Invocation invocation)
This method is used by Mockito to implement argument captor functionality (seeArgumentCaptor
.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.-
Methods inherited from interface org.mockito.invocation.DescribedInvocation
getLocation, toString
-
-
-
-
Method Detail
-
getInvocation
Invocation getInvocation()
The actual invocation Mockito will match against.- Since:
- 2.2.12
-
getMatchers
List<ArgumentMatcher> getMatchers()
The argument matchers of this invocation. When the invocation is declared without argument matchers (e.g. using plain arguments) Mockito still converts them intoArgumentMatcher
instances that use 'eq' matching viaArgumentMatchers.eq(Object)
.- Since:
- 2.2.12
-
matches
boolean matches(Invocation candidate)
Same method, mock and all arguments match.- Since:
- 2.2.12
-
hasSimilarMethod
boolean hasSimilarMethod(Invocation candidate)
Candidate invocation has the similar method. 'Similar' means the same method name, same mock, unverified, not overloaded, but not necessarily matching arguments- Since:
- 2.2.12
-
hasSameMethod
boolean hasSameMethod(Invocation candidate)
Returns true if the candidate invocation has the same method (method name and parameter types)- Since:
- 2.2.12
-
captureArgumentsFrom
void captureArgumentsFrom(Invocation invocation)
This method is used by Mockito to implement argument captor functionality (seeArgumentCaptor
.Makes this instance of matchable invocation capture all arguments of provided invocation.
- Parameters:
invocation
- the invocation to capture the arguments from- Since:
- 2.2.12
-
-