Package org.mockito.invocation
Interface InvocationOnMock
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
Invocation
- All Known Implementing Classes:
InvocationImpl
An invocation on a mock
A placeholder for mock, the method that was called and the arguments that were passed.
-
Method Summary
Modifier and TypeMethodDescriptioncalls real method<T> T
getArgumentAt
(int index, Class<T> clazz) Returns casted argument using positionObject[]
returns arguments passed to the methodreturns the methodgetMock()
returns the mock object
-
Method Details
-
getMock
Object getMock()returns the mock object- Returns:
- mock object
-
getMethod
Method getMethod()returns the method- Returns:
- method
-
getArguments
Object[] getArguments()returns arguments passed to the method- Returns:
- arguments
-
getArgumentAt
Returns casted argument using position- Parameters:
index
- argument positionclazz
- argument type- Returns:
- casted argument on position
-
callRealMethod
calls real methodWarning: depending on the real implementation it might throw exceptions
- Returns:
- whatever the real method returns / throws
- Throws:
Throwable
- in case real method throws
-