public class InterceptedInvocation extends Object implements Invocation, VerificationAwareInvocation
Modifier and Type | Field and Description |
---|---|
static RealMethod |
NO_OP |
Constructor and Description |
---|
InterceptedInvocation(MockReference<Object> mockRef,
MockitoMethod mockitoMethod,
Object[] arguments,
RealMethod realMethod,
Location location,
int sequenceNumber) |
Modifier and Type | Method and Description |
---|---|
Object |
callRealMethod()
calls real method
|
boolean |
equals(Object o) |
<T> T |
getArgument(int index)
Returns casted argument at the given index.
|
Object[] |
getArguments()
Returns arguments passed to the method.
|
Location |
getLocation()
The place in the code where the invocation happened.
|
Method |
getMethod()
returns the method
|
Object |
getMock()
returns the mock object
|
Object[] |
getRawArguments()
Returns unprocessed arguments whereas
InvocationOnMock.getArguments() returns
arguments already processed (e.g. |
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() |
String |
toString()
Describes the invocation in the human friendly way.
|
public static final RealMethod NO_OP
public InterceptedInvocation(MockReference<Object> mockRef, MockitoMethod mockitoMethod, Object[] arguments, RealMethod realMethod, Location location, int sequenceNumber)
public boolean isVerified()
isVerified
in interface VerificationAwareInvocation
isVerified
in interface Invocation
Mockito.verifyNoMoreInteractions(Object...)
public int getSequenceNumber()
getSequenceNumber
in interface Invocation
public Location getLocation()
DescribedInvocation
getLocation
in interface DescribedInvocation
getLocation
in interface Invocation
public Object[] getRawArguments()
Invocation
InvocationOnMock.getArguments()
returns
arguments already processed (e.g. varargs expended, etc.).getRawArguments
in interface Invocation
public Class<?> getRawReturnType()
Invocation
InvocationOnMock.getArguments()
returns
arguments already processed (e.g. varargs expended, etc.).getRawReturnType
in interface Invocation
public void markVerified()
Invocation
Mockito.verifyNoMoreInteractions(Object...)
markVerified
in interface Invocation
public StubInfo stubInfo()
stubInfo
in interface Invocation
public void markStubbed(StubInfo stubInfo)
Invocation
markStubbed
in interface Invocation
stubInfo
- the information about stubbing.public boolean isIgnoredForVerification()
Invocation
isIgnoredForVerification
in interface Invocation
public void ignoreForVerification()
Invocation
Invocation.isIgnoredForVerification()
ignoreForVerification
in interface Invocation
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 <T> T getArgument(int index)
InvocationOnMock
InvocationOnMock.getArguments()
.getArgument
in interface InvocationOnMock
index
- argument indexpublic 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 String toString()
DescribedInvocation
toString
in interface DescribedInvocation
toString
in class Object
Copyright © 2020. All rights reserved.