Uses of Interface
org.mockito.MockSettings
Packages that use MockSettings
-
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.genericTypeToMock
(Type genericTypeToMock) Specifies the generic type of the mock, preserving the information lost to Java type erasure.MockSettings.invocationListeners
(InvocationListener... listeners) Registers a listener for method invocations on this mock.MockSettings.lenient()
Deprecated.Specifies theMockMaker
for the mock.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.strictness
(Strictness strictness) Specifies strictness level for the mock.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 metadata 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> T
Mockito.mock
(MockSettings settings, T... reified) Creates a mock object of the requested class or interface with the given 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.
strictness(Strictness)
instead.