Class MockInvocation

  • All Implemented Interfaces:
    IMockInvocation

    public class MockInvocation
    extends java.lang.Object
    implements IMockInvocation
    Author:
    Peter Niederwieser
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object callRealMethod()
      Delegates this method invocation to the real object underlying this mock object, including any method arguments.
      java.lang.Object callRealMethodWithArgs​(java.lang.Object... arguments)
      Delegates this method invocation to the real object underlying this mock object, replacing the original method arguments with the specified arguments.
      boolean equals​(java.lang.Object other)  
      java.util.List<java.lang.Object> getArguments()
      The arguments for the invocation.
      IMockMethod getMethod()
      The invoked method.
      IMockObject getMockObject()
      The mock object that received the invocation.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getArguments

        public java.util.List<java.lang.Object> getArguments()
        Description copied from interface: IMockInvocation
        The arguments for the invocation.
        Specified by:
        getArguments in interface IMockInvocation
      • callRealMethod

        public java.lang.Object callRealMethod()
        Description copied from interface: IMockInvocation
        Delegates this method invocation to the real object underlying this mock object, including any method arguments. If this mock object has no underlying real object, a CannotInvokeRealMethodException is thrown.
        Specified by:
        callRealMethod in interface IMockInvocation
        Returns:
        the return value of the method to which this invocation was delegated
      • callRealMethodWithArgs

        public java.lang.Object callRealMethodWithArgs​(java.lang.Object... arguments)
        Description copied from interface: IMockInvocation
        Delegates this method invocation to the real object underlying this mock object, replacing the original method arguments with the specified arguments. If this mock object has no underlying real object, a CannotInvokeRealMethodException is thrown.
        Specified by:
        callRealMethodWithArgs in interface IMockInvocation
        Returns:
        the return value of the method to which this invocation was delegated
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object