Class DefaultInvocationFactory

    • Constructor Detail

      • DefaultInvocationFactory

        public DefaultInvocationFactory()
    • 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 interface InvocationFactory
        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 an Invocation object. This method is useful for framework integrators to programmatically simulate method calls on mocks using MockHandler. It enables advanced framework integrations.
        Specified by:
        createInvocation in interface InvocationFactory
        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)