Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see Mockito class for for usage.
|
Modifier and Type | Method and Description |
---|---|
MockSettings |
MockSettings.defaultAnswer(Answer defaultAnswer)
Specifies default answers to interactions.
|
MockSettings |
MockSettings.extraInterfaces(Class<?>... interfaces)
Specifies extra interfaces the mock should implement.
|
MockSettings |
MockSettings.invocationListeners(InvocationListener... listeners)
Registers a listener for method invocations on this mock.
|
MockSettings |
MockSettings.name(String name)
Specifies mock name.
|
MockSettings |
MockSettings.outerInstance(Object outerClassInstance)
Makes it possible to mock non-static inner classes in conjunction with
useConstructor() . |
MockSettings |
MockSettings.serializable()
Configures the mock to be serializable.
|
MockSettings |
MockSettings.serializable(SerializableMode mode)
Configures the mock to be serializable with a specific serializable mode.
|
MockSettings |
MockSettings.spiedInstance(Object instance)
Specifies the instance to spy on.
|
MockSettings |
MockSettings.stubOnly()
A stub-only mock does not record method
invocations, thus saving memory but
disallowing verification of invocations.
|
MockSettings |
MockSettings.useConstructor()
Mockito attempts to use constructor when creating instance of the mock.
|
MockSettings |
MockSettings.verboseLogging()
Enables real-time logging of method invocations on this mock.
|
static MockSettings |
Mockito.withSettings()
Allows mock creation with additional mock settings.
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
Mockito.mock(Class<T> classToMock,
MockSettings mockSettings)
Creates a mock with some non-standard settings.
|