Package org.spockframework.mock
Interface IMockInvocation
-
- All Known Implementing Classes:
DelegatingMockInvocation
,MockInvocation
public interface IMockInvocation
A method invocation on a mock object.- Author:
- Peter Niederwieser
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
callRealMethod()
Delegates this method invocation to the real object underlying this mock object, including any method arguments.java.lang.Object
callRealMethodWithArgs(java.lang.Object... arguments)
Delegates this method invocation to the real object underlying this mock object, replacing the original method arguments with the specified arguments.java.util.List<java.lang.Object>
getArguments()
The arguments for the invocation.IMockMethod
getMethod()
The invoked method.IMockObject
getMockObject()
The mock object that received the invocation.
-
-
-
Method Detail
-
getMockObject
IMockObject getMockObject()
The mock object that received the invocation.
-
getMethod
IMockMethod getMethod()
The invoked method.
-
getArguments
java.util.List<java.lang.Object> getArguments()
The arguments for the invocation.
-
callRealMethod
java.lang.Object callRealMethod()
Delegates this method invocation to the real object underlying this mock object, including any method arguments. If this mock object has no underlying real object, aCannotInvokeRealMethodException
is thrown.- Returns:
- the return value of the method to which this invocation was delegated
-
callRealMethodWithArgs
java.lang.Object callRealMethodWithArgs(java.lang.Object... arguments)
Delegates this method invocation to the real object underlying this mock object, replacing the original method arguments with the specified arguments. If this mock object has no underlying real object, aCannotInvokeRealMethodException
is thrown.- Returns:
- the return value of the method to which this invocation was delegated
-
-