Package org.elasticsearch.test.rest.yaml
Class ClientYamlTestClient
- java.lang.Object
-
- org.elasticsearch.test.rest.yaml.ClientYamlTestClient
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
ClientYamlDocsTestClient
public class ClientYamlTestClient extends java.lang.Object implements java.io.CloseableUsed byESClientYamlSuiteTestCaseto execute REST requests according to the tests written in yaml suite files. Wraps aRestClientinstance used to send the REST requests. Holds theClientYamlSuiteRestSpecused to translate api calls into REST calls.
-
-
Method Summary
Modifier and Type Method Description ClientYamlTestResponsecallApi(java.lang.String apiName, java.util.Map<java.lang.String,java.lang.String> params, org.apache.http.HttpEntity entity, java.util.Map<java.lang.String,java.lang.String> headers, NodeSelector nodeSelector)Calls an api with the provided parameters and bodyvoidclose()VersiongetEsVersion()VersiongetMasterVersion()protected RestClientgetRestClient(NodeSelector nodeSelector)protected static voidsetOptions(Request request, java.util.Map<java.lang.String,java.lang.String> headers)
-
-
-
Method Detail
-
getEsVersion
public Version getEsVersion()
-
getMasterVersion
public Version getMasterVersion()
-
callApi
public ClientYamlTestResponse callApi(java.lang.String apiName, java.util.Map<java.lang.String,java.lang.String> params, org.apache.http.HttpEntity entity, java.util.Map<java.lang.String,java.lang.String> headers, NodeSelector nodeSelector) throws java.io.IOException
Calls an api with the provided parameters and body- Throws:
java.io.IOException
-
getRestClient
protected RestClient getRestClient(NodeSelector nodeSelector)
-
setOptions
protected static void setOptions(Request request, java.util.Map<java.lang.String,java.lang.String> headers)
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-