Class ClientYamlTestClient
java.lang.Object
org.opensearch.test.rest.yaml.ClientYamlTestClient
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ClientYamlDocsTestClient
Used by
OpenSearchClientYamlSuiteTestCase to execute REST requests according to the tests written in yaml suite files. Wraps a
RestClient instance used to send the REST requests. Holds the ClientYamlSuiteRestSpec used to translate api calls into
REST calls.-
Method Summary
Modifier and TypeMethodDescriptioncallApi(String apiName, Map<String, String> params, org.apache.hc.core5.http.HttpEntity entity, Map<String, String> headers, org.opensearch.client.NodeSelector nodeSelector) Calls an api with the provided parameters and bodyvoidclose()org.opensearch.Versionorg.opensearch.Versionprotected org.opensearch.client.RestClientgetRestClient(org.opensearch.client.NodeSelector nodeSelector) protected static voidsetOptions(org.opensearch.client.Request request, Map<String, String> headers)
-
Method Details
-
getEsVersion
public org.opensearch.Version getEsVersion() -
getClusterManagerVersion
public org.opensearch.Version getClusterManagerVersion() -
callApi
public ClientYamlTestResponse callApi(String apiName, Map<String, String> params, org.apache.hc.core5.http.HttpEntity entity, Map<String, throws IOExceptionString> headers, org.opensearch.client.NodeSelector nodeSelector) Calls an api with the provided parameters and body- Throws:
IOException
-
getRestClient
protected org.opensearch.client.RestClient getRestClient(org.opensearch.client.NodeSelector nodeSelector) -
setOptions
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-