Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see
Mockito class for usage. |
org.mockito.internal |
Internal classes, not to be used by clients.
|
org.mockito.internal.creation |
Mock object creation.
|
org.mockito.internal.stubbing.defaultanswers |
Implementations of default Answers.
|
Modifier and Type | Method and Description |
---|---|
MockSettings |
MockSettings.defaultAnswer(Answer defaultAnswer)
Specifies default answers to interactions.
|
MockSettings |
MockSettings.extraInterfaces(java.lang.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.lenient()
Lenient mocks bypass "strict stubbing" validation (see
Strictness.STRICT_STUBS ). |
MockSettings |
MockSettings.name(java.lang.String name)
Specifies mock name.
|
MockSettings |
MockSettings.outerInstance(java.lang.Object outerClassInstance)
Makes it possible to mock non-static inner classes in conjunction with
useConstructor(Object...) . |
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(java.lang.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(java.lang.Object... args)
Mockito attempts to use constructor when creating instance of the mock.
|
MockSettings |
MockSettings.verboseLogging()
Enables real-time logging of method invocations on this mock.
|
MockSettings |
MockSettings.verificationStartedListeners(VerificationStartedListener... listeners)
Registers a listener(s) that will be notified when user starts verification.
|
MockSettings |
MockSettings.withoutAnnotations()
By default, Mockito makes an attempt to preserve all annotation meta data on the mocked
type and its methods to mirror the mocked type as closely as possible.
|
static MockSettings |
Mockito.withSettings()
Allows mock creation with additional mock settings.
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
Mockito.mock(java.lang.Class<T> classToMock,
MockSettings mockSettings)
Creates a mock with some non-standard settings.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
MockitoCore.mock(java.lang.Class<T> typeToMock,
MockSettings settings) |
Modifier and Type | Class and Description |
---|---|
class |
MockSettingsImpl<T> |
Modifier and Type | Method and Description |
---|---|
MockSettings |
MockSettingsImpl.defaultAnswer(Answer defaultAnswer) |
MockSettings |
MockSettingsImpl.extraInterfaces(java.lang.Class<?>... extraInterfaces) |
MockSettings |
MockSettingsImpl.invocationListeners(InvocationListener... listeners) |
MockSettings |
MockSettingsImpl.lenient() |
MockSettings |
MockSettingsImpl.name(java.lang.String name) |
MockSettings |
MockSettingsImpl.outerInstance(java.lang.Object outerClassInstance) |
MockSettings |
MockSettingsImpl.serializable() |
MockSettings |
MockSettingsImpl.serializable(SerializableMode mode) |
MockSettings |
MockSettingsImpl.spiedInstance(java.lang.Object spiedInstance) |
MockSettings |
MockSettingsImpl.useConstructor(java.lang.Object... constructorArgs) |
MockSettings |
MockSettingsImpl.verboseLogging() |
MockSettings |
MockSettingsImpl.verificationStartedListeners(VerificationStartedListener... listeners) |
MockSettings |
MockSettingsImpl.withoutAnnotations() |
Modifier and Type | Method and Description |
---|---|
private MockSettings |
ReturnsDeepStubs.propagateSerializationSettings(MockSettings mockSettings,
MockCreationSettings parentMockSettings) |
private MockSettings |
ReturnsDeepStubs.withSettingsUsing(GenericMetadataSupport returnTypeGenericMetadata,
MockCreationSettings parentMockSettings) |
Modifier and Type | Method and Description |
---|---|
private MockSettings |
ReturnsDeepStubs.propagateSerializationSettings(MockSettings mockSettings,
MockCreationSettings parentMockSettings) |