Package org.mockito.internal.invocation
Class DefaultInvocationFactory
java.lang.Object
org.mockito.internal.invocation.DefaultInvocationFactory
- All Implemented Interfaces:
InvocationFactory
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mockito.invocation.InvocationFactory
InvocationFactory.RealMethodBehavior<R> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InterceptedInvocationcreateInvocation(Object mock, Method invokedMethod, Object[] arguments, RealMethod realMethod, MockCreationSettings settings, Location location) createInvocation(Object target, MockCreationSettings settings, Method method, Callable realMethod, Object... args) createInvocation(Object target, MockCreationSettings settings, Method method, InvocationFactory.RealMethodBehavior realMethod, Object... args) Creates instance of anInvocationobject.
-
Constructor Details
-
DefaultInvocationFactory
public DefaultInvocationFactory()
-
-
Method Details
-
createInvocation
public Invocation createInvocation(Object target, MockCreationSettings settings, Method method, Callable realMethod, Object... args) -
createInvocation
public Invocation createInvocation(Object target, MockCreationSettings settings, Method method, InvocationFactory.RealMethodBehavior realMethod, Object... args) Description copied from interface:InvocationFactoryCreates instance of anInvocationobject. This method is useful for framework integrators to programmatically simulate method calls on mocks usingMockHandler. It enables advanced framework integrations.- Specified by:
createInvocationin interfaceInvocationFactory- Parameters:
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 arguments- Returns:
- invocation instance
-
createInvocation
public static InterceptedInvocation createInvocation(Object mock, Method invokedMethod, Object[] arguments, RealMethod realMethod, MockCreationSettings settings, Location location)
-