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 TypeMethodDescriptionprivate static InterceptedInvocation
createInvocation
(Object mock, Method invokedMethod, Object[] arguments, RealMethod realMethod, MockCreationSettings settings) static InterceptedInvocation
createInvocation
(Object mock, Method invokedMethod, Object[] arguments, RealMethod realMethod, MockCreationSettings settings, Location location) createInvocation
(Object target, MockCreationSettings settings, Method method, Callable realMethod, Object... args) private Invocation
createInvocation
(Object target, MockCreationSettings settings, Method method, RealMethod superMethod, Object[] args) createInvocation
(Object target, MockCreationSettings settings, Method method, InvocationFactory.RealMethodBehavior realMethod, Object... args) Creates instance of anInvocation
object.private static MockitoMethod
createMockitoMethod
(Method method, MockCreationSettings settings)
-
Constructor Details
-
DefaultInvocationFactory
public DefaultInvocationFactory()
-
-
Method Details
-
createInvocation
public Invocation createInvocation(Object target, MockCreationSettings settings, Method method, Callable realMethod, Object... args) - Specified by:
createInvocation
in 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 Invocation createInvocation(Object target, MockCreationSettings settings, Method method, InvocationFactory.RealMethodBehavior realMethod, Object... args) Description copied from interface:InvocationFactory
Creates instance of anInvocation
object. This method is useful for framework integrators to programmatically simulate method calls on mocks usingMockHandler
. It enables advanced framework integrations.- Specified by:
createInvocation
in 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
private Invocation createInvocation(Object target, MockCreationSettings settings, Method method, RealMethod superMethod, Object[] args) -
createInvocation
public static InterceptedInvocation createInvocation(Object mock, Method invokedMethod, Object[] arguments, RealMethod realMethod, MockCreationSettings settings, Location location) -
createInvocation
private static InterceptedInvocation createInvocation(Object mock, Method invokedMethod, Object[] arguments, RealMethod realMethod, MockCreationSettings settings) -
createMockitoMethod
-