Uses of Interface
org.mockito.mock.MockCreationSettings
Packages that use MockCreationSettings
Package
Description
Mockito is a mock library for java - see
Mockito class for usage.Public API related to mock method invocations.
Public classes relative to the listener APIs.
Mockito plugins allow customization of behavior.
-
Uses of MockCreationSettings in org.mockito
Methods in org.mockito that return MockCreationSettingsModifier and TypeMethodDescription<T> MockCreationSettings<T> Creates immutable view of mock settings used later by Mockito.<T> MockCreationSettings<T> MockSettings.buildStatic(Class<T> classToMock) Creates immutable view of mock settings used later by Mockito, for use within a static mocking.MockingDetails.getMockCreationSettings()Returns various mock settings provided when the mock was created, for example: mocked class, mock name (if any), any extra interfaces (if any), etc. -
Uses of MockCreationSettings in org.mockito.invocation
Methods in org.mockito.invocation that return MockCreationSettingsModifier and TypeMethodDescriptionMockHandler.getMockSettings()Read-only settings the mock object was created with.Methods in org.mockito.invocation with parameters of type MockCreationSettingsModifier and TypeMethodDescriptionInvocationFactory.createInvocation(Object target, MockCreationSettings settings, Method method, InvocationFactory.RealMethodBehavior realMethod, Object... args) Creates instance of anInvocationobject. -
Uses of MockCreationSettings in org.mockito.listeners
Methods in org.mockito.listeners that return MockCreationSettingsMethods in org.mockito.listeners with parameters of type MockCreationSettingsModifier and TypeMethodDescriptionvoidMockCreationListener.onMockCreated(Object mock, MockCreationSettings settings) Mock object was just created.default voidMockCreationListener.onStaticMockCreated(Class<?> mock, MockCreationSettings settings) Static mock object was just created. -
Uses of MockCreationSettings in org.mockito.plugins
Methods in org.mockito.plugins with parameters of type MockCreationSettingsModifier and TypeMethodDescriptiondefault StringDoNotMockEnforcer.checkTypeForDoNotMockViolation(MockCreationSettings<?> creationSettings) Check whether this type is allowed to be mocked.DoNotMockEnforcerWithType.checkTypeForDoNotMockViolation(MockCreationSettings<?> creationSettings) Check whether this type is allowed to be mocked.<T> TMockMaker.createMock(MockCreationSettings<T> settings, MockHandler handler) If you want to provide your own implementation ofMockMakerthis method should: Create a proxy object that implementssettings.typeToMockand potentially alsosettings.extraInterfaces. You may use the information fromsettingsto create/configure your proxy object. Your proxy object should carry thehandlerwith it.default <T> Optional<T> MockMaker.createSpy(MockCreationSettings<T> settings, MockHandler handler, T instance) By implementing this method, a mock maker can optionally support the creation of spies where all fields are set within a constructor.default <T> MockMaker.StaticMockControl<T> MockMaker.createStaticMock(Class<T> type, MockCreationSettings<T> settings, MockHandler handler) If you want to provide your own implementation ofMockMakerthis method should: Alter the supplied class to only change its behavior in the current thread. Only alters the static method's behavior after being enabled. Stops the altered behavior when disabled.InstantiatorProvider2.getInstantiator(MockCreationSettings<?> settings) Returns an instantiator, used to create new class instances.voidMockMaker.resetMock(Object mock, MockHandler newHandler, MockCreationSettings settings) Replaces the existing handler onmockwithnewHandler.Method parameters in org.mockito.plugins with type arguments of type MockCreationSettingsModifier and TypeMethodDescriptiondefault <T> MockMaker.ConstructionMockControl<T> MockMaker.createConstructionMock(Class<T> type, Function<MockedConstruction.Context, MockCreationSettings<T>> settingsFactory, Function<MockedConstruction.Context, MockHandler<T>> handlerFactory, MockedConstruction.MockInitializer<T> mockInitializer) If you want to provide your own implementation ofMockMakerthis method should: Intercept all constructions of the specified type in the current thread Only intercept the construction after being enabled. Stops the interception when disabled.