Class RestActionTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.test.rest.RestActionTestCase

public abstract class RestActionTestCase extends OpenSearchTestCase
A common base class for Rest*ActionTests. Provides access to a RestController that can be used to register individual REST actions, and test request handling.
  • Field Details

  • Constructor Details

    • RestActionTestCase

      public RestActionTestCase()
  • Method Details

    • setUpController

      public void setUpController()
    • tearDownController

      public void tearDownController()
    • controller

      protected org.opensearch.rest.RestController controller()
      A test RestController. This controller can be used to register and delegate to handlers, but uses a mock client and cannot carry out the full request.
    • dispatchRequest

      protected void dispatchRequest(org.opensearch.rest.RestRequest request)
      Sends the given request to the test controller in controller().