MockCreationSettings
Date: 2015-09-18

org.mockito.mock

## Interface MockCreationSettings<T>

- All Known Implementing Classes:
    CreationSettings, MockSettingsImpl

      public interface MockCreationSettings<T>

  Informs about the mock settings. An immutable view of `MockSettings`.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Answer` | `getDefaultAnswer()` the default answer for this mock, see `MockSettings.defaultAnswer(org.mockito.stubbing.Answer)`.
    `java.util.Set<java.lang.Class>` | `getExtraInterfaces()` the extra interfaces the mock object should implement.
    `java.util.List<InvocationListener>` | `getInvocationListeners()` The invocation listeners attached to this mock, see `MockSettings.invocationListeners(org.mockito.listeners.InvocationListener...)`.
    `MockName` | `getMockName()` the name of this mock, as printed on verification errors; see `MockSettings.name(java.lang.String)`.
    `java.lang.Object` | `getOuterClassInstance()` Used when mocking non-static inner classes in conjunction with `isUsingConstructor()`
    `SerializableMode` | `getSerializableMode()`
    `java.lang.Object` | `getSpiedInstance()` the spied instance - needed for spies.
    `java.lang.Class<T>` | `getTypeToMock()` Mocked type.
    `boolean` | `isSerializable()` if the mock is serializable, see `MockSettings.serializable()`.
    `boolean` | `isStubOnly()` Whether the mock is only for stubbing, i.e.
    `boolean` | `isUsingConstructor()` Informs whether the mock instance should be created via constructor

- - ### Method Detail

    - #### getTypeToMock

          java.lang.Class<T> getTypeToMock()

      Mocked type. An interface or class the mock should implement / extend.

    - #### getExtraInterfaces

          java.util.Set<java.lang.Class> getExtraInterfaces()

      the extra interfaces the mock object should implement.

    - #### getMockName

          MockName getMockName()

      the name of this mock, as printed on verification errors; see `MockSettings.name(java.lang.String)`.

    - #### getDefaultAnswer

          Answer getDefaultAnswer()

      the default answer for this mock, see `MockSettings.defaultAnswer(org.mockito.stubbing.Answer)`.

    - #### getSpiedInstance

          java.lang.Object getSpiedInstance()

      the spied instance - needed for spies.

    - #### isSerializable

          boolean isSerializable()

      if the mock is serializable, see `MockSettings.serializable()`.

    - #### getSerializableMode

          SerializableMode getSerializableMode()

      Returns:
        the serializable mode of this mock

    - #### isStubOnly

          boolean isStubOnly()

      Whether the mock is only for stubbing, i.e. does not remember parameters on its invocation and therefore cannot be used for verification

    - #### getInvocationListeners

          java.util.List<InvocationListener> getInvocationListeners()

      The invocation listeners attached to this mock, see `MockSettings.invocationListeners(org.mockito.listeners.InvocationListener...)`.

    - #### isUsingConstructor

          @Incubating
          boolean isUsingConstructor()

      Informs whether the mock instance should be created via constructor
      Since:
        1.10.12

    - #### getOuterClassInstance

          @Incubating
          java.lang.Object getOuterClassInstance()

      Used when mocking non-static inner classes in conjunction with `isUsingConstructor()`
      Returns:
        the outer class instance used for creation of the mock object via the constructor.
      Since:
        1.10.12