Mock
Date: 2015-09-15

org.jmock

## Class Mock

- java.lang.Object
- - org.jmock.Mock

- All Implemented Interfaces:
    BuilderNamespace, DynamicMock, Verifiable

      public class Mock
      extends java.lang.Object
      implements DynamicMock, BuilderNamespace

  Since:
    1.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Mock(java.lang.Class mockedType)`
    `Mock(java.lang.Class mockedType, java.lang.String name)`
    `Mock(DynamicMock coreMock)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addInvokable(Invokable invokable)`
    `NameMatchBuilder` | `expects(InvocationMatcher expectation)`
    `java.lang.Class` | `getMockedType()`
    `MatchBuilder` | `lookupID(java.lang.String id)`
    `java.lang.Object` | `proxy()`
    `void` | `registerMethodName(java.lang.String id, MatchBuilder builder)`
    `void` | `registerUniqueID(java.lang.String id, MatchBuilder builder)`
    `void` | `reset()`
    `void` | `setDefaultStub(Stub newDefaultStub)`
    `NameMatchBuilder` | `stubs()`
    `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`

- - ### Constructor Detail

    - #### Mock

          public Mock(java.lang.Class mockedType)

    - #### Mock

          public Mock(java.lang.Class mockedType,
              java.lang.String name)

    - #### Mock

          public Mock(DynamicMock coreMock)

  - ### Method Detail

    - #### getMockedType

          public java.lang.Class getMockedType()

      Specified by:
        `getMockedType` in interface `DynamicMock`

    - #### proxy

          public java.lang.Object proxy()

      Specified by:
        `proxy` in interface `DynamicMock`

    - #### toString

          public java.lang.String toString()

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

    - #### 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`

    - #### addInvokable

          public void addInvokable(Invokable invokable)

      Specified by:
        `addInvokable` in interface `DynamicMock`

    - #### stubs

          public NameMatchBuilder stubs()

    - #### expects

          public NameMatchBuilder expects(InvocationMatcher expectation)

    - #### setDefaultStub

          public void setDefaultStub(Stub newDefaultStub)

      Specified by:
        `setDefaultStub` in interface `DynamicMock`

    - #### reset

          public void reset()

      Specified by:
        `reset` in interface `DynamicMock`

    - #### lookupID

          public MatchBuilder lookupID(java.lang.String id)

      Specified by:
        `lookupID` in interface `BuilderNamespace`

    - #### registerUniqueID

          public void registerUniqueID(java.lang.String id,
                              MatchBuilder builder)

      Specified by:
        `registerUniqueID` in interface `BuilderNamespace`

    - #### registerMethodName

          public void registerMethodName(java.lang.String id,
                                MatchBuilder builder)

      Specified by:
        `registerMethodName` in interface `BuilderNamespace`