public class DefaultInvocationFactory extends java.lang.Object implements InvocationFactory
InvocationFactory.RealMethodBehavior<R>
Constructor and Description |
---|
DefaultInvocationFactory() |
Modifier and Type | Method and Description |
---|---|
private static InterceptedInvocation |
createInvocation(java.lang.Object mock,
java.lang.reflect.Method invokedMethod,
java.lang.Object[] arguments,
RealMethod realMethod,
MockCreationSettings settings) |
static InterceptedInvocation |
createInvocation(java.lang.Object mock,
java.lang.reflect.Method invokedMethod,
java.lang.Object[] arguments,
RealMethod realMethod,
MockCreationSettings settings,
Location location) |
Invocation |
createInvocation(java.lang.Object target,
MockCreationSettings settings,
java.lang.reflect.Method method,
java.util.concurrent.Callable realMethod,
java.lang.Object... args) |
Invocation |
createInvocation(java.lang.Object target,
MockCreationSettings settings,
java.lang.reflect.Method method,
InvocationFactory.RealMethodBehavior realMethod,
java.lang.Object... args)
Creates instance of an
Invocation object. |
private Invocation |
createInvocation(java.lang.Object target,
MockCreationSettings settings,
java.lang.reflect.Method method,
RealMethod superMethod,
java.lang.Object[] args) |
private static MockitoMethod |
createMockitoMethod(java.lang.reflect.Method method,
MockCreationSettings settings) |
public Invocation createInvocation(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, java.util.concurrent.Callable realMethod, java.lang.Object... args)
createInvocation
in interface InvocationFactory
target
- the mock object the method is invoked on.settings
- creation settings of the mock object.method
- java method invoked on mock.realMethod
- real method behavior. Needed for spying / invoking real behavior on mock objects.args
- the java method argumentspublic Invocation createInvocation(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, InvocationFactory.RealMethodBehavior realMethod, java.lang.Object... args)
InvocationFactory
Invocation
object.
This method is useful for framework integrators to programmatically simulate method calls on mocks using MockHandler
.
It enables advanced framework integrations.createInvocation
in interface InvocationFactory
target
- the mock object the method is invoked on.settings
- creation settings of the mock object.method
- java method invoked on mock.realMethod
- real method behavior. Needed for spying / invoking real behavior on mock objects.args
- the java method argumentsprivate Invocation createInvocation(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, RealMethod superMethod, java.lang.Object[] args)
public static InterceptedInvocation createInvocation(java.lang.Object mock, java.lang.reflect.Method invokedMethod, java.lang.Object[] arguments, RealMethod realMethod, MockCreationSettings settings, Location location)
private static InterceptedInvocation createInvocation(java.lang.Object mock, java.lang.reflect.Method invokedMethod, java.lang.Object[] arguments, RealMethod realMethod, MockCreationSettings settings)
private static MockitoMethod createMockitoMethod(java.lang.reflect.Method method, MockCreationSettings settings)