org.mockito.internal.invocation
Class Invocation

java.lang.Object
  extended by org.mockito.internal.invocation.Invocation
All Implemented Interfaces:
PrintableInvocation, CanPrintInMultilines, InvocationOnMock

public class Invocation
extends java.lang.Object
implements PrintableInvocation, InvocationOnMock, CanPrintInMultilines

Method call on a mock object.

Contains sequence number which should be globally unique and is used for verification in order.

Contains stack trace of invocation


Constructor Summary
Invocation(java.lang.Object mock, java.lang.reflect.Method method, java.lang.Object[] args, int sequenceNumber)
           
 
Method Summary
protected  java.util.List<org.hamcrest.Matcher> argumentsToMatchers()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object[] getArguments()
          returns arguments passed to the method
 java.lang.reflect.Method getMethod()
          returns the method
 java.lang.Object getMock()
          returns the mock object
 java.lang.Integer getSequenceNumber()
           
 HasStackTrace getStackTrace()
           
 int hashCode()
           
static boolean isToString(InvocationOnMock invocation)
           
 boolean isValidException(java.lang.Throwable throwable)
           
 boolean isVerified()
           
 boolean isVerifiedInOrder()
           
 boolean isVoid()
           
 void markVerified()
           
 void markVerifiedInOrder()
           
 boolean printsInMultilines()
           
 java.lang.String toMultilineString()
           
 java.lang.String toString()
           
protected  java.lang.String toString(java.util.List<org.hamcrest.Matcher> matchers, boolean forceMultiline)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Invocation

public Invocation(java.lang.Object mock,
                  java.lang.reflect.Method method,
                  java.lang.Object[] args,
                  int sequenceNumber)
Method Detail

getMock

public java.lang.Object getMock()
Description copied from interface: InvocationOnMock
returns the mock object

Specified by:
getMock in interface InvocationOnMock
Returns:
mock object

getMethod

public java.lang.reflect.Method getMethod()
Description copied from interface: InvocationOnMock
returns the method

Specified by:
getMethod in interface InvocationOnMock
Returns:
method

getArguments

public java.lang.Object[] getArguments()
Description copied from interface: InvocationOnMock
returns arguments passed to the method

Specified by:
getArguments in interface InvocationOnMock
Returns:
arguments

markVerified

public void markVerified()

isVerified

public boolean isVerified()

getSequenceNumber

public java.lang.Integer getSequenceNumber()

markVerifiedInOrder

public void markVerifiedInOrder()

isVerifiedInOrder

public boolean isVerifiedInOrder()

getStackTrace

public HasStackTrace getStackTrace()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

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

toString

public java.lang.String toString()
Specified by:
toString in interface PrintableInvocation
Specified by:
toString in interface CanPrintInMultilines
Overrides:
toString in class java.lang.Object

printsInMultilines

public boolean printsInMultilines()
Specified by:
printsInMultilines in interface CanPrintInMultilines

toMultilineString

public java.lang.String toMultilineString()
Specified by:
toMultilineString in interface CanPrintInMultilines

toString

protected java.lang.String toString(java.util.List<org.hamcrest.Matcher> matchers,
                                    boolean forceMultiline)

argumentsToMatchers

protected java.util.List<org.hamcrest.Matcher> argumentsToMatchers()

isToString

public static boolean isToString(InvocationOnMock invocation)

isValidException

public boolean isValidException(java.lang.Throwable throwable)

isVoid

public boolean isVoid()