public class InvocationMatcher extends Object implements MatchableInvocation, DescribedInvocation, Serializable
| Constructor and Description |
|---|
InvocationMatcher(Invocation invocation) |
InvocationMatcher(Invocation invocation,
List<ArgumentMatcher> matchers) |
| Modifier and Type | Method and Description |
|---|---|
void |
captureArgumentsFrom(Invocation invocation)
This method is used by Mockito to implement argument captor functionality (see
ArgumentCaptor. |
static List<InvocationMatcher> |
createFrom(List<Invocation> invocations) |
Invocation |
getInvocation()
The actual invocation Mockito will match against.
|
Location |
getLocation()
The place in the code where the invocation happened.
|
List<ArgumentMatcher> |
getMatchers()
The argument matchers of this invocation.
|
Method |
getMethod() |
boolean |
hasSameMethod(Invocation candidate)
Returns true if the candidate invocation has the same method (method name and parameter types)
|
boolean |
hasSimilarMethod(Invocation candidate)
similar means the same method name, same mock, unverified and: if arguments are the same cannot be overloaded
|
boolean |
matches(Invocation candidate)
Same method, mock and all arguments match.
|
String |
toString()
Describes the invocation in the human friendly way.
|
public InvocationMatcher(Invocation invocation, List<ArgumentMatcher> matchers)
public InvocationMatcher(Invocation invocation)
public static List<InvocationMatcher> createFrom(List<Invocation> invocations)
public Method getMethod()
public Invocation getInvocation()
MatchableInvocationgetInvocation in interface MatchableInvocationpublic List<ArgumentMatcher> getMatchers()
MatchableInvocationArgumentMatcher instances
that use 'eq' matching via ArgumentMatchers.eq(Object).getMatchers in interface MatchableInvocationpublic String toString()
DescribedInvocationtoString in interface DescribedInvocationtoString in class Objectpublic boolean matches(Invocation candidate)
MatchableInvocationmatches in interface MatchableInvocationpublic boolean hasSimilarMethod(Invocation candidate)
hasSimilarMethod in interface MatchableInvocationpublic boolean hasSameMethod(Invocation candidate)
MatchableInvocationhasSameMethod in interface MatchableInvocationpublic Location getLocation()
DescribedInvocationgetLocation in interface DescribedInvocationpublic void captureArgumentsFrom(Invocation invocation)
MatchableInvocationArgumentCaptor.
Makes this instance of matchable invocation capture all arguments of provided invocation.
captureArgumentsFrom in interface MatchableInvocationinvocation - the invocation to capture the arguments fromCopyright © 2024. All rights reserved.