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()
MatchableInvocation
getInvocation
in interface MatchableInvocation
public List<ArgumentMatcher> getMatchers()
MatchableInvocation
ArgumentMatcher
instances
that use 'eq' matching via ArgumentMatchers.eq(Object)
.getMatchers
in interface MatchableInvocation
public String toString()
DescribedInvocation
toString
in interface DescribedInvocation
toString
in class Object
public boolean matches(Invocation candidate)
MatchableInvocation
matches
in interface MatchableInvocation
public boolean hasSimilarMethod(Invocation candidate)
hasSimilarMethod
in interface MatchableInvocation
public boolean hasSameMethod(Invocation candidate)
MatchableInvocation
hasSameMethod
in interface MatchableInvocation
public Location getLocation()
DescribedInvocation
getLocation
in interface DescribedInvocation
public void captureArgumentsFrom(Invocation invocation)
MatchableInvocation
ArgumentCaptor
.
Makes this instance of matchable invocation capture all arguments of provided invocation.
captureArgumentsFrom
in interface MatchableInvocation
invocation
- the invocation to capture the arguments fromCopyright © 2024. All rights reserved.