Uses of Interface
org.mockito.MockSettings
Packages that use MockSettings
Package
Description
Mockito is a mock library for java - see
Mockito
class for usage.Internal classes, not to be used by clients.
Mock object creation.
Implementations of default Answers.
-
Uses of MockSettings in org.mockito
Methods in org.mockito that return MockSettingsModifier and TypeMethodDescriptionMockSettings.defaultAnswer
(Answer defaultAnswer) Specifies default answers to interactions.MockSettings.extraInterfaces
(Class<?>... interfaces) Specifies extra interfaces the mock should implement.MockSettings.invocationListeners
(InvocationListener... listeners) Registers a listener for method invocations on this mock.MockSettings.lenient()
Lenient mocks bypass "strict stubbing" validation (seeStrictness.STRICT_STUBS
).Specifies mock name.MockSettings.outerInstance
(Object outerClassInstance) Makes it possible to mock non-static inner classes in conjunction withuseConstructor(Object...)
.MockSettings.serializable()
Configures the mock to be serializable.MockSettings.serializable
(SerializableMode mode) Configures the mock to be serializable with a specific serializable mode.MockSettings.spiedInstance
(Object instance) Specifies the instance to spy on.MockSettings.stubbingLookupListeners
(StubbingLookupListener... listeners) Add stubbing lookup listener to the mock object.MockSettings.stubOnly()
A stub-only mock does not record method invocations, thus saving memory but disallowing verification of invocations.MockSettings.useConstructor
(Object... args) Mockito attempts to use constructor when creating instance of the mock.MockSettings.verboseLogging()
Enables real-time logging of method invocations on this mock.MockSettings.verificationStartedListeners
(VerificationStartedListener... listeners) Registers a listener(s) that will be notified when user starts verification.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.Methods in org.mockito with parameters of type MockSettingsModifier and TypeMethodDescriptionstatic <T> T
Mockito.mock
(Class<T> classToMock, MockSettings mockSettings) Creates a mock with some non-standard settings.static <T> MockedConstruction<T>
Mockito.mockConstruction
(Class<T> classToMock, MockSettings mockSettings) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>
Mockito.mockConstruction
(Class<T> classToMock, MockSettings mockSettings, MockedConstruction.MockInitializer<T> mockInitializer) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedStatic<T>
Mockito.mockStatic
(Class<T> classToMock, MockSettings mockSettings) Creates a thread-local mock controller for all static methods of the given class or interface.Method parameters in org.mockito with type arguments of type MockSettingsModifier and TypeMethodDescriptionstatic <T> MockedConstruction<T>
Mockito.mockConstruction
(Class<T> classToMock, Function<MockedConstruction.Context, MockSettings> mockSettingsFactory) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>
Mockito.mockConstruction
(Class<T> classToMock, Function<MockedConstruction.Context, MockSettings> mockSettingsFactory, MockedConstruction.MockInitializer<T> mockInitializer) Creates a thread-local mock controller for all constructions of the given class. -
Uses of MockSettings in org.mockito.internal
Methods in org.mockito.internal with parameters of type MockSettingsModifier and TypeMethodDescription<T> T
MockitoCore.mock
(Class<T> typeToMock, MockSettings settings) <T> MockedStatic<T>
MockitoCore.mockStatic
(Class<T> classToMock, MockSettings settings) Method parameters in org.mockito.internal with type arguments of type MockSettingsModifier and TypeMethodDescription<T> MockedConstruction<T>
MockitoCore.mockConstruction
(Class<T> typeToMock, Function<MockedConstruction.Context, ? extends MockSettings> settingsFactory, MockedConstruction.MockInitializer<T> mockInitializer) -
Uses of MockSettings in org.mockito.internal.creation
Classes in org.mockito.internal.creation that implement MockSettingsMethods in org.mockito.internal.creation that return MockSettingsModifier and TypeMethodDescriptionMockSettingsImpl.defaultAnswer
(Answer defaultAnswer) MockSettingsImpl.extraInterfaces
(Class<?>... extraInterfaces) MockSettingsImpl.invocationListeners
(InvocationListener... listeners) MockSettingsImpl.lenient()
MockSettingsImpl.outerInstance
(Object outerClassInstance) MockSettingsImpl.serializable()
MockSettingsImpl.serializable
(SerializableMode mode) MockSettingsImpl.spiedInstance
(Object spiedInstance) MockSettingsImpl.stubbingLookupListeners
(StubbingLookupListener... listeners) MockSettingsImpl.useConstructor
(Object... constructorArgs) MockSettingsImpl.verboseLogging()
MockSettingsImpl.verificationStartedListeners
(VerificationStartedListener... listeners) MockSettingsImpl.withoutAnnotations()
-
Uses of MockSettings in org.mockito.internal.stubbing.defaultanswers
Methods in org.mockito.internal.stubbing.defaultanswers that return MockSettingsModifier and TypeMethodDescriptionprivate MockSettings
ReturnsDeepStubs.propagateSerializationSettings
(MockSettings mockSettings, MockCreationSettings parentMockSettings) private MockSettings
ReturnsDeepStubs.withSettingsUsing
(GenericMetadataSupport returnTypeGenericMetadata, MockCreationSettings parentMockSettings) Methods in org.mockito.internal.stubbing.defaultanswers with parameters of type MockSettingsModifier and TypeMethodDescriptionprivate MockSettings
ReturnsDeepStubs.propagateSerializationSettings
(MockSettings mockSettings, MockCreationSettings parentMockSettings)