public class InvocationMatcher extends java.lang.Object implements MatchableInvocation, DescribedInvocation, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private Invocation |
invocation |
private java.util.List<ArgumentMatcher<?>> |
matchers |
| Constructor and Description |
|---|
InvocationMatcher(Invocation invocation) |
InvocationMatcher(Invocation invocation,
java.util.List<ArgumentMatcher> matchers) |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
argumentsMatch(Invocation actual) |
private ArgumentMatcherAction |
captureArgument() |
void |
captureArgumentsFrom(Invocation invocation)
This method is used by Mockito to implement argument captor functionality (see
ArgumentCaptor. |
static java.util.List<InvocationMatcher> |
createFrom(java.util.List<Invocation> invocations) |
Invocation |
getInvocation()
The actual invocation Mockito will match against.
|
Location |
getLocation()
The place in the code where the invocation happened.
|
java.util.List<ArgumentMatcher> |
getMatchers()
The argument matchers of this invocation.
|
java.lang.reflect.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.
|
java.lang.String |
toString()
Describes the invocation in the human friendly way.
|
private final Invocation invocation
private final java.util.List<ArgumentMatcher<?>> matchers
public InvocationMatcher(Invocation invocation, java.util.List<ArgumentMatcher> matchers)
public InvocationMatcher(Invocation invocation)
public static java.util.List<InvocationMatcher> createFrom(java.util.List<Invocation> invocations)
public java.lang.reflect.Method getMethod()
public Invocation getInvocation()
MatchableInvocationgetInvocation in interface MatchableInvocationpublic java.util.List<ArgumentMatcher> getMatchers()
MatchableInvocationArgumentMatcher instances
that use 'eq' matching via ArgumentMatchers.eq(Object).getMatchers in interface MatchableInvocationpublic java.lang.String toString()
DescribedInvocationtoString in interface DescribedInvocationtoString in class java.lang.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 fromprivate ArgumentMatcherAction captureArgument()
private boolean argumentsMatch(Invocation actual)