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.Closeable
Used byESClientYamlSuiteTestCase
to execute REST requests according to the tests written in yaml suite files. Wraps aRestClient
instance used to send the REST requests. Holds theClientYamlSuiteRestSpec
used to translate api calls into REST calls.
-
-
Method Summary
Modifier and Type Method Description 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)
Calls an api with the provided parameters and bodyvoid
close()
Version
getEsVersion()
Version
getMasterVersion()
protected RestClient
getRestClient(NodeSelector nodeSelector)
protected static void
setOptions(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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-