Class TestCapturingListener<T>

java.lang.Object
org.opensearch.common.util.TestCapturingListener<T>
Type Parameters:
T - the result type
All Implemented Interfaces:
org.opensearch.core.action.ActionListener<T>

public class TestCapturingListener<T> extends Object implements org.opensearch.core.action.ActionListener<T>
A simple implementation of ActionListener that captures the response and failures used for testing purposes.
  • Constructor Details

    • TestCapturingListener

      public TestCapturingListener()
  • Method Details

    • onResponse

      public void onResponse(T result)
      Specified by:
      onResponse in interface org.opensearch.core.action.ActionListener<T>
    • onFailure

      public void onFailure(Exception e)
      Specified by:
      onFailure in interface org.opensearch.core.action.ActionListener<T>
    • getResult

      public T getResult()
    • getFailure

      public Exception getFailure()