public class DefaultInvocationFactory extends Object implements InvocationFactory
InvocationFactory.RealMethodBehavior<R>
Constructor and Description |
---|
DefaultInvocationFactory() |
Modifier and Type | Method and Description |
---|---|
static InterceptedInvocation |
createInvocation(Object mock,
Method invokedMethod,
Object[] arguments,
RealMethod realMethod,
MockCreationSettings settings,
Location location) |
Invocation |
createInvocation(Object target,
MockCreationSettings settings,
Method method,
Callable realMethod,
Object... args) |
Invocation |
createInvocation(Object target,
MockCreationSettings settings,
Method method,
InvocationFactory.RealMethodBehavior realMethod,
Object... args)
Creates instance of an
Invocation object. |
public Invocation createInvocation(Object target, MockCreationSettings settings, Method method, Callable realMethod, 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(Object target, MockCreationSettings settings, Method method, InvocationFactory.RealMethodBehavior realMethod, 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 argumentspublic static InterceptedInvocation createInvocation(Object mock, Method invokedMethod, Object[] arguments, RealMethod realMethod, MockCreationSettings settings, Location location)
Copyright © 2018. All rights reserved.