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
Modifier and TypeMethodDescriptionDelegates this method invocation to the real object underlying this mock object, including any method arguments.callRealMethodWithArgs
(Object... arguments) Delegates this method invocation to the real object underlying this mock object, replacing the original method arguments with the specified arguments.The arguments for the invocation.The invoked method.The mock object that received the invocation.
-
Method Details
-
getMockObject
IMockObject getMockObject()The mock object that received the invocation. -
getMethod
IMockMethod getMethod()The invoked method. -
getArguments
The arguments for the invocation. -
callRealMethod
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
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
-