Class MockUtils

java.lang.Object
org.elasticsearch.test.MockUtils

public class MockUtils extends Object
Utilities for setting up Mockito mocks.
  • Constructor Details

    • MockUtils

      public MockUtils()
  • Method Details

    • setupTransportServiceWithThreadpoolExecutor

      public static TransportService setupTransportServiceWithThreadpoolExecutor()
      Sets up a mock TransportService that can answer calls to TransportService.getThreadPool().executor(String).
      Returns:
      A mocked TransportService instance
    • setupTransportServiceWithThreadpoolExecutor

      public static TransportService setupTransportServiceWithThreadpoolExecutor(ThreadPool threadPool)
      Sets up a mock TransportService that can answer calls to TransportService.getThreadPool().executor(String), using the given threadPool in TransportService.
      Parameters:
      threadPool - A mock ThreadPool
      Returns:
      A mocked TransportService instance