Package org.elasticsearch.test.mockito
Class SecureMockMaker
java.lang.Object
org.elasticsearch.test.mockito.SecureMockMaker
- All Implemented Interfaces:
org.mockito.plugins.MockMaker
A
MockMaker
that works with SecurityManager
.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
<T> org.mockito.plugins.MockMaker.ConstructionMockControl<T>
createConstructionMock
(Class<T> type, Function<org.mockito.MockedConstruction.Context, org.mockito.mock.MockCreationSettings<T>> settingsFactory, Function<org.mockito.MockedConstruction.Context, org.mockito.invocation.MockHandler<T>> handlerFactory, org.mockito.MockedConstruction.MockInitializer<T> mockInitializer) <T> T
createMock
(org.mockito.mock.MockCreationSettings<T> mockCreationSettings, org.mockito.invocation.MockHandler mockHandler) <T> Optional<T>
createSpy
(org.mockito.mock.MockCreationSettings<T> settings, org.mockito.invocation.MockHandler handler, T object) <T> org.mockito.plugins.MockMaker.StaticMockControl<T>
createStaticMock
(Class<T> type, org.mockito.mock.MockCreationSettings<T> settings, org.mockito.invocation.MockHandler handler) org.mockito.invocation.MockHandler
getHandler
(Object o) static void
init()
org.mockito.plugins.MockMaker.TypeMockability
isTypeMockable
(Class<?> type) void
resetMock
(Object o, org.mockito.invocation.MockHandler mockHandler, org.mockito.mock.MockCreationSettings mockCreationSettings)
-
Constructor Details
-
SecureMockMaker
public SecureMockMaker()
-
-
Method Details
-
init
public static void init() -
createMock
public <T> T createMock(org.mockito.mock.MockCreationSettings<T> mockCreationSettings, org.mockito.invocation.MockHandler mockHandler) - Specified by:
createMock
in interfaceorg.mockito.plugins.MockMaker
-
createSpy
public <T> Optional<T> createSpy(org.mockito.mock.MockCreationSettings<T> settings, org.mockito.invocation.MockHandler handler, T object) - Specified by:
createSpy
in interfaceorg.mockito.plugins.MockMaker
-
getHandler
- Specified by:
getHandler
in interfaceorg.mockito.plugins.MockMaker
-
resetMock
public void resetMock(Object o, org.mockito.invocation.MockHandler mockHandler, org.mockito.mock.MockCreationSettings mockCreationSettings) - Specified by:
resetMock
in interfaceorg.mockito.plugins.MockMaker
-
isTypeMockable
- Specified by:
isTypeMockable
in interfaceorg.mockito.plugins.MockMaker
-
createStaticMock
public <T> org.mockito.plugins.MockMaker.StaticMockControl<T> createStaticMock(Class<T> type, org.mockito.mock.MockCreationSettings<T> settings, org.mockito.invocation.MockHandler handler) - Specified by:
createStaticMock
in interfaceorg.mockito.plugins.MockMaker
-
createConstructionMock
public <T> org.mockito.plugins.MockMaker.ConstructionMockControl<T> createConstructionMock(Class<T> type, Function<org.mockito.MockedConstruction.Context, org.mockito.mock.MockCreationSettings<T>> settingsFactory, Function<org.mockito.MockedConstruction.Context, org.mockito.invocation.MockHandler<T>> handlerFactory, org.mockito.MockedConstruction.MockInitializer<T> mockInitializer) - Specified by:
createConstructionMock
in interfaceorg.mockito.plugins.MockMaker
-
clearAllCaches
public void clearAllCaches()- Specified by:
clearAllCaches
in interfaceorg.mockito.plugins.MockMaker
-