Class NoOpClient

java.lang.Object
org.elasticsearch.client.support.AbstractClient
org.elasticsearch.test.client.NoOpClient
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.client.Client, org.elasticsearch.client.ElasticsearchClient, org.elasticsearch.core.Releasable

public class NoOpClient extends org.elasticsearch.client.support.AbstractClient
Client that always responds with null to every request. Override doExecute(ActionType, ActionRequest, ActionListener) for testing. See also NoOpNodeClient if you need to mock a NodeClient.
  • Field Summary

    Fields inherited from class org.elasticsearch.client.support.AbstractClient

    logger, settings

    Fields inherited from interface org.elasticsearch.client.Client

    CLIENT_TYPE_SETTING_S
  • Constructor Summary

    Constructors
    Constructor
    Description
    NoOpClient​(String testName)
    Create a new TestThreadPool for this client.
    NoOpClient​(org.elasticsearch.threadpool.ThreadPool threadPool)
    Build with ThreadPool.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected <Request extends org.elasticsearch.action.ActionRequest,​ Response extends org.elasticsearch.action.ActionResponse>
    void
    doExecute​(org.elasticsearch.action.ActionType<Response> action, Request request, org.elasticsearch.action.ActionListener<Response> listener)
     

    Methods inherited from class org.elasticsearch.client.support.AbstractClient

    admin, bulk, bulk, clearScroll, clearScroll, delete, delete, execute, execute, explain, explain, fieldCaps, fieldCaps, filterWithHeader, get, get, index, index, multiGet, multiGet, multiSearch, multiSearch, multiTermVectors, multiTermVectors, prepareBulk, prepareBulk, prepareClearScroll, prepareDelete, prepareDelete, prepareExplain, prepareFieldCaps, prepareGet, prepareGet, prepareIndex, prepareIndex, prepareMultiGet, prepareMultiSearch, prepareMultiTermVectors, prepareSearch, prepareSearchScroll, prepareTermVectors, prepareTermVectors, prepareUpdate, prepareUpdate, search, search, searchScroll, searchScroll, settings, termVectors, termVectors, threadPool, update, update

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.client.Client

    getRemoteClusterClient
  • Constructor Details

    • NoOpClient

      public NoOpClient(org.elasticsearch.threadpool.ThreadPool threadPool)
      Build with ThreadPool. This ThreadPool is terminated on close().
    • NoOpClient

      public NoOpClient(String testName)
      Create a new TestThreadPool for this client. This TestThreadPool is terminated on close().
  • Method Details

    • doExecute

      protected <Request extends org.elasticsearch.action.ActionRequest,​ Response extends org.elasticsearch.action.ActionResponse> void doExecute(org.elasticsearch.action.ActionType<Response> action, Request request, org.elasticsearch.action.ActionListener<Response> listener)
      Specified by:
      doExecute in class org.elasticsearch.client.support.AbstractClient
    • close

      public void close()