InvocationOnMock
Date: 2015-09-18

org.mockito.invocation

## Interface InvocationOnMock

- All Superinterfaces:
    java.io.Serializable
  All Known Subinterfaces:
    Invocation
  All Known Implementing Classes:
    InvocationImpl

      public interface InvocationOnMock
      extends java.io.Serializable

  An invocation on a mock

  A placeholder for mock, the method that was called and the arguments that were passed.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `callRealMethod()` calls real method
    `<T> T` | `getArgumentAt(int index, java.lang.Class<T> clazz)` Returns casted argument using position
    `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

- - ### Method Detail

    - #### getMock

          java.lang.Object getMock()

      returns the mock object
      Returns:
        mock object

    - #### getMethod

          java.lang.reflect.Method getMethod()

      returns the method
      Returns:
        method

    - #### getArguments

          java.lang.Object[] getArguments()

      returns arguments passed to the method
      Returns:
        arguments

    - #### getArgumentAt

          <T> T getArgumentAt(int index,
                            java.lang.Class<T> clazz)

      Returns casted argument using position
      Parameters:
        `index` - argument position
        `clazz` - argument type
      Returns:
        casted argument on position

    - #### callRealMethod

          java.lang.Object callRealMethod()
                                          throws java.lang.Throwable

      calls real method

      Warning: depending on the real implementation it might throw exceptions

      Returns:
        whatever the real method returns / throws
      Throws:
        `java.lang.Throwable` - in case real method throws