ExpectationMap
Date: 2015-09-15

org.jmock.expectation

## Class ExpectationMap

- java.lang.Object
- - org.jmock.expectation.ExpectationMap

- All Implemented Interfaces:
    Verifiable, Expectation

      public class ExpectationMap
      extends java.lang.Object
      implements Expectation, Verifiable

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExpectationMap(java.lang.String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addExpected(java.lang.Object key, java.lang.Object value)`
    `void` | `addExpectedMissing(java.lang.Object key)`
    `java.lang.Object` | `get(java.lang.Object key)`
    `boolean` | `hasExpectations()` Return true if any expectations have been set on this object.
    `void` | `setExpectNothing()` Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.
    `void` | `setFailOnVerify()` If an incorrect actual value is set, defer reporting this as a failure until verify() is called on this object.
    `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, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExpectationMap

          public ExpectationMap(java.lang.String name)

  - ### Method Detail

    - #### addExpected

          public void addExpected(java.lang.Object key,
                         java.lang.Object value)

    - #### addExpectedMissing

          public void addExpectedMissing(java.lang.Object key)

    - #### get

          public java.lang.Object get(java.lang.Object key)

    - #### hasExpectations

          public boolean hasExpectations()

      Description copied from interface: `Expectation`
      Return true if any expectations have been set on this object.
      Specified by:
        `hasExpectations` in interface `Expectation`

    - #### setExpectNothing

          public void setExpectNothing()

      Description copied from interface: `Expectation`
      Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. The Expectation will fail if any actual values are set.

      Note that this is not the same as not setting any expectations, in which case verify() will do nothing.
      Specified by:
        `setExpectNothing` in interface `Expectation`

    - #### setFailOnVerify

          public void setFailOnVerify()

      Description copied from interface: `Expectation`
      If an incorrect actual value is set, defer reporting this as a failure until verify() is called on this object.
      Specified by:
        `setFailOnVerify` in interface `Expectation`

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