public class InterceptedInvocation extends java.lang.Object implements Invocation, VerificationAwareInvocation
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object[] |
arguments |
private boolean |
isIgnoredForVerification |
private Location |
location |
private MockitoMethod |
mockitoMethod |
private MockReference<java.lang.Object> |
mockRef |
static RealMethod |
NO_OP |
private java.lang.Object[] |
rawArguments |
private RealMethod |
realMethod |
private int |
sequenceNumber |
private static long |
serialVersionUID |
private StubInfo |
stubInfo |
private boolean |
verified |
| Constructor and Description |
|---|
InterceptedInvocation(MockReference<java.lang.Object> mockRef,
MockitoMethod mockitoMethod,
java.lang.Object[] arguments,
RealMethod realMethod,
Location location,
int sequenceNumber) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
callRealMethod()
calls real method
|
private boolean |
equalArguments(java.lang.Object[] arguments) |
boolean |
equals(java.lang.Object o) |
<T> T |
getArgument(int index)
Returns casted argument at the given index.
|
java.lang.Object[] |
getArguments()
Returns arguments passed to the method.
|
Location |
getLocation()
The place in the code where the invocation happened.
|
java.lang.reflect.Method |
getMethod()
returns the method
|
java.lang.Object |
getMock()
returns the mock object
|
java.lang.Object[] |
getRawArguments()
Returns unprocessed arguments whereas
InvocationOnMock.getArguments() returns
arguments already processed (e.g. |
java.lang.Class<?> |
getRawReturnType()
Returns unprocessed arguments whereas
InvocationOnMock.getArguments() returns
arguments already processed (e.g. |
int |
getSequenceNumber() |
int |
hashCode() |
void |
ignoreForVerification()
Configures this invocation to be ignored for verify-no-more-invocations or verification in order.
|
boolean |
isIgnoredForVerification()
Informs if the invocation participates in verify-no-more-invocations or verification in order.
|
boolean |
isVerified() |
void |
markStubbed(StubInfo stubInfo)
Marks this invocation as stubbed.
|
void |
markVerified()
Marks this invocation as verified so that it will not cause verification error at
Mockito.verifyNoMoreInteractions(Object...) |
StubInfo |
stubInfo() |
java.lang.String |
toString()
Describes the invocation in the human friendly way.
|
private static final long serialVersionUID
private final MockReference<java.lang.Object> mockRef
private final MockitoMethod mockitoMethod
private final java.lang.Object[] arguments
private final java.lang.Object[] rawArguments
private final RealMethod realMethod
private final int sequenceNumber
private final Location location
private boolean verified
private boolean isIgnoredForVerification
private StubInfo stubInfo
public static final RealMethod NO_OP
public InterceptedInvocation(MockReference<java.lang.Object> mockRef, MockitoMethod mockitoMethod, java.lang.Object[] arguments, RealMethod realMethod, Location location, int sequenceNumber)
public boolean isVerified()
isVerified in interface VerificationAwareInvocationisVerified in interface InvocationMockito.verifyNoMoreInteractions(Object...)public int getSequenceNumber()
getSequenceNumber in interface Invocationpublic Location getLocation()
DescribedInvocationgetLocation in interface DescribedInvocationgetLocation in interface Invocationpublic java.lang.Object[] getRawArguments()
InvocationInvocationOnMock.getArguments() returns
arguments already processed (e.g. varargs expended, etc.).getRawArguments in interface Invocationpublic java.lang.Class<?> getRawReturnType()
InvocationInvocationOnMock.getArguments() returns
arguments already processed (e.g. varargs expended, etc.).getRawReturnType in interface Invocationpublic void markVerified()
InvocationMockito.verifyNoMoreInteractions(Object...)markVerified in interface Invocationpublic StubInfo stubInfo()
stubInfo in interface Invocationpublic void markStubbed(StubInfo stubInfo)
InvocationmarkStubbed in interface InvocationstubInfo - the information about stubbing.public boolean isIgnoredForVerification()
InvocationisIgnoredForVerification in interface Invocationpublic void ignoreForVerification()
InvocationInvocation.isIgnoredForVerification()ignoreForVerification in interface Invocationpublic 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 <T> T getArgument(int index)
InvocationOnMockInvocationOnMock.getArguments().getArgument in interface InvocationOnMockindex - argument indexpublic 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 int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprivate boolean equalArguments(java.lang.Object[] arguments)
public java.lang.String toString()
DescribedInvocationtoString in interface DescribedInvocationtoString in class java.lang.Object