public class Invocation extends java.lang.Object implements PrintableInvocation, InvocationOnMock, PrintingFriendlyInvocation, VerificationAwareInvocation
Contains sequence number which should be globally unique and is used for verification in order.
Contains stack trace of invocation
| Constructor and Description |
|---|
Invocation(java.lang.Object mock,
MockitoMethod mockitoMethod,
java.lang.Object[] args,
int sequenceNumber,
RealMethod realMethod) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<org.hamcrest.Matcher> |
argumentsToMatchers() |
java.lang.Object |
callRealMethod()
calls real method
|
boolean |
equals(java.lang.Object o) |
java.lang.Object[] |
getArguments()
returns arguments passed to the method
|
int |
getArgumentsCount() |
Location |
getLocation() |
java.lang.reflect.Method |
getMethod()
returns the method
|
java.lang.String |
getMethodName() |
java.lang.Object |
getMock()
returns the mock object
|
java.lang.Object[] |
getRawArguments() |
java.lang.Integer |
getSequenceNumber() |
int |
hashCode() |
void |
ignoreForVerification() |
boolean |
isDeclaredOnInterface() |
boolean |
isIgnoredForVerification() |
boolean |
isToString() |
boolean |
isValidException(java.lang.Throwable throwable) |
boolean |
isValidReturnType(java.lang.Class clazz) |
boolean |
isVerified() |
boolean |
isVoid() |
void |
markStubbed(StubInfo stubInfo) |
java.lang.String |
printMethodReturnType() |
boolean |
returnsPrimitive() |
StubInfo |
stubInfo() |
java.lang.String |
toString() |
protected java.lang.String |
toString(java.util.List<org.hamcrest.Matcher> matchers,
PrintSettings printSettings) |
java.lang.String |
toString(PrintSettings printSettings) |
public Invocation(java.lang.Object mock,
MockitoMethod mockitoMethod,
java.lang.Object[] args,
int sequenceNumber,
RealMethod realMethod)
public java.lang.Object getMock()
InvocationOnMockgetMock in interface InvocationOnMockpublic java.lang.reflect.Method getMethod()
InvocationOnMockgetMethod in interface InvocationOnMockpublic java.lang.Object[] getArguments()
InvocationOnMockgetArguments in interface InvocationOnMockpublic boolean isVerified()
isVerified in interface VerificationAwareInvocationpublic java.lang.Integer getSequenceNumber()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in interface PrintableInvocationtoString in class java.lang.Objectprotected java.lang.String toString(java.util.List<org.hamcrest.Matcher> matchers,
PrintSettings printSettings)
protected java.util.List<org.hamcrest.Matcher> argumentsToMatchers()
public boolean isToString()
public boolean isValidException(java.lang.Throwable throwable)
public boolean isValidReturnType(java.lang.Class clazz)
public boolean isVoid()
public java.lang.String printMethodReturnType()
public java.lang.String getMethodName()
public boolean returnsPrimitive()
public Location getLocation()
getLocation in interface PrintableInvocationpublic int getArgumentsCount()
public java.lang.Object[] getRawArguments()
public java.lang.Object callRealMethod()
throws java.lang.Throwable
InvocationOnMockWarning: depending on the real implementation it might throw exceptions
callRealMethod in interface InvocationOnMockjava.lang.Throwable - in case real method throwspublic boolean isDeclaredOnInterface()
public java.lang.String toString(PrintSettings printSettings)
toString in interface PrintingFriendlyInvocationpublic StubInfo stubInfo()
public void markStubbed(StubInfo stubInfo)
public boolean isIgnoredForVerification()
public void ignoreForVerification()