Class ActionTestUtils

java.lang.Object
org.opensearch.action.support.ActionTestUtils

public class ActionTestUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> org.opensearch.core.action.ActionListener<T>
    assertNoFailureListener(org.opensearch.common.CheckedConsumer<T, Exception> consumer)
     
    static <Request extends org.opensearch.action.ActionRequest, Response extends org.opensearch.core.action.ActionResponse>
    void
    execute(org.opensearch.action.support.TransportAction<Request,Response> action, org.opensearch.tasks.Task task, Request request, org.opensearch.core.action.ActionListener<Response> listener)
    Executes the given action.
    static <Request extends org.opensearch.action.ActionRequest, Response extends org.opensearch.core.action.ActionResponse>
    Response
    executeBlocking(org.opensearch.action.support.TransportAction<Request,Response> action, Request request)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • executeBlocking

      public static <Request extends org.opensearch.action.ActionRequest, Response extends org.opensearch.core.action.ActionResponse> Response executeBlocking(org.opensearch.action.support.TransportAction<Request,Response> action, Request request)
    • execute

      public static <Request extends org.opensearch.action.ActionRequest, Response extends org.opensearch.core.action.ActionResponse> void execute(org.opensearch.action.support.TransportAction<Request,Response> action, org.opensearch.tasks.Task task, Request request, org.opensearch.core.action.ActionListener<Response> listener)
      Executes the given action.

      This is a shim method to make execution publicly available in tests.

    • assertNoFailureListener

      public static <T> org.opensearch.core.action.ActionListener<T> assertNoFailureListener(org.opensearch.common.CheckedConsumer<T, Exception> consumer)