Package org.mockito.internal.invocation
Class DefaultInvocationFactory
- java.lang.Object
-
- org.mockito.internal.invocation.DefaultInvocationFactory
-
- All Implemented Interfaces:
InvocationFactory
public class DefaultInvocationFactory extends java.lang.Object implements InvocationFactory
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mockito.invocation.InvocationFactory
InvocationFactory.RealMethodBehavior<R>
-
-
Constructor Summary
Constructors Constructor Description DefaultInvocationFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
private Invocation
createInvocation(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, RealMethod superMethod, 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 anInvocation
object.private static MockitoMethod
createMockitoMethod(java.lang.reflect.Method method, MockCreationSettings settings)
-
-
-
Method Detail
-
createInvocation
public Invocation createInvocation(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, java.util.concurrent.Callable realMethod, java.lang.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(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, InvocationFactory.RealMethodBehavior realMethod, java.lang.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(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, RealMethod superMethod, java.lang.Object[] args)
-
createInvocation
public static InterceptedInvocation createInvocation(java.lang.Object mock, java.lang.reflect.Method invokedMethod, java.lang.Object[] arguments, RealMethod realMethod, MockCreationSettings settings, Location location)
-
createInvocation
private static InterceptedInvocation createInvocation(java.lang.Object mock, java.lang.reflect.Method invokedMethod, java.lang.Object[] arguments, RealMethod realMethod, MockCreationSettings settings)
-
createMockitoMethod
private static MockitoMethod createMockitoMethod(java.lang.reflect.Method method, MockCreationSettings settings)
-
-