Class SecureMockMaker

java.lang.Object
org.elasticsearch.test.mockito.SecureMockMaker
All Implemented Interfaces:
org.mockito.plugins.MockMaker

public class SecureMockMaker extends Object implements org.mockito.plugins.MockMaker
A MockMaker that works with SecurityManager.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.mockito.plugins.MockMaker

    org.mockito.plugins.MockMaker.ConstructionMockControl<T extends Object>, org.mockito.plugins.MockMaker.StaticMockControl<T extends Object>, org.mockito.plugins.MockMaker.TypeMockability
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    <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
     
    static void
     
    org.mockito.plugins.MockMaker.TypeMockability
     
    void
    resetMock(Object o, org.mockito.invocation.MockHandler mockHandler, org.mockito.mock.MockCreationSettings mockCreationSettings)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface org.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 interface org.mockito.plugins.MockMaker
    • getHandler

      public org.mockito.invocation.MockHandler getHandler(Object o)
      Specified by:
      getHandler in interface org.mockito.plugins.MockMaker
    • resetMock

      public void resetMock(Object o, org.mockito.invocation.MockHandler mockHandler, org.mockito.mock.MockCreationSettings mockCreationSettings)
      Specified by:
      resetMock in interface org.mockito.plugins.MockMaker
    • isTypeMockable

      public org.mockito.plugins.MockMaker.TypeMockability isTypeMockable(Class<?> type)
      Specified by:
      isTypeMockable in interface org.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 interface org.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 interface org.mockito.plugins.MockMaker
    • clearAllCaches

      public void clearAllCaches()
      Specified by:
      clearAllCaches in interface org.mockito.plugins.MockMaker