InvocationMocker
Date: 2015-09-15

org.jmock.core

## Class InvocationMocker

- java.lang.Object
- - org.jmock.core.InvocationMocker

- All Implemented Interfaces:
    Invokable, SelfDescribing, StubMatchersCollection, Verifiable

      public class InvocationMocker
      extends java.lang.Object
      implements Invokable, StubMatchersCollection

  Since:
    1.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `InvocationMocker.Describer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static InvocationMocker.Describer` | `DEFAULT_DESCRIBER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvocationMocker()`
    `InvocationMocker(InvocationMocker.Describer describer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMatcher(InvocationMatcher matcher)`
    `java.lang.StringBuffer` | `describeTo(java.lang.StringBuffer buffer)` Appends the description of this object to the buffer.
    `boolean` | `hasDescription()`
    `java.lang.Object` | `invoke(Invocation invocation)`
    `boolean` | `matches(Invocation invocation)`
    `void` | `setName(java.lang.String name)`
    `void` | `setStub(Stub stub)`
    `java.lang.String` | `toString()`
    `void` | `verify()` Throw an AssertionFailedException if any expectations have not been met.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_DESCRIBER

          public static final InvocationMocker.Describer DEFAULT_DESCRIBER

  - ### Constructor Detail

    - #### InvocationMocker

          public InvocationMocker()

    - #### InvocationMocker

          public InvocationMocker(InvocationMocker.Describer describer)

  - ### Method Detail

    - #### matches

          public boolean matches(Invocation invocation)

      Specified by:
        `matches` in interface `Invokable`

    - #### invoke

          public java.lang.Object invoke(Invocation invocation)
                                  throws java.lang.Throwable

      Specified by:
        `invoke` in interface `Invokable`
      Throws:
        `java.lang.Throwable`

    - #### verify

          public void verify()

      Description copied from interface: `Verifiable`
      Throw an AssertionFailedException if any expectations have not been met. Implementations of this method must be idempotent: jMock can call this method more than once when verifying expectations at the end of a test.
      Specified by:
        `verify` in interface `Verifiable`

    - #### setName

          public void setName(java.lang.String name)

      Specified by:
        `setName` in interface `StubMatchersCollection`

    - #### addMatcher

          public void addMatcher(InvocationMatcher matcher)

      Specified by:
        `addMatcher` in interface `StubMatchersCollection`

    - #### setStub

          public void setStub(Stub stub)

      Specified by:
        `setStub` in interface `StubMatchersCollection`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### hasDescription

          public boolean hasDescription()

      Specified by:
        `hasDescription` in interface `Invokable`

    - #### describeTo

          public java.lang.StringBuffer describeTo(java.lang.StringBuffer buffer)

      Description copied from interface: `SelfDescribing`
      Appends the description of this object to the buffer.
      Specified by:
        `describeTo` in interface `SelfDescribing`
      Parameters:
        `buffer` - The buffer that the description is appended to.
      Returns:
        The buffer passed to the invokedMethod.