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()
InvocationOnMock
getMock
in interface InvocationOnMock
public Method getMethod()
InvocationOnMock
getMethod
in interface InvocationOnMock
public Object[] getArguments()
InvocationOnMock
getArguments
in interface InvocationOnMock
public boolean isVerified()
public Integer getSequenceNumber()
public String toString()
toString
in interface PrintableInvocation
toString
in class Object
protected 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 PrintableInvocation
public int getArgumentsCount()
public Object[] getRawArguments()
public Object callRealMethod() throws Throwable
InvocationOnMock
Warning: depending on the real implementation it might throw exceptions
callRealMethod
in interface InvocationOnMock
Throwable
- in case real method throwspublic boolean isDeclaredOnInterface()
public String toString(PrintSettings printSettings)
toString
in interface PrintingFriendlyInvocation
public StubInfo stubInfo()
public void markStubbed(StubInfo stubInfo)
Copyright © 2016. All rights reserved.