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