Package org.elasticsearch.test.rest.yaml
Class ClientYamlTestExecutionContext
- java.lang.Object
-
- org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext
-
public class ClientYamlTestExecutionContext extends java.lang.Object
Execution context passed across the REST tests. Holds the REST client used to communicate with elasticsearch. Caches the last obtained test response and allows to stash part of it within variables that can be used as input values in following requests.
-
-
Method Summary
Modifier and Type Method Description ClientYamlTestResponse
callApi(java.lang.String apiName, java.util.Map<java.lang.String,java.lang.String> params, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> bodies, java.util.Map<java.lang.String,java.lang.String> headers)
Calls an elasticsearch api with the parameters and request body provided as arguments.ClientYamlTestResponse
callApi(java.lang.String apiName, java.util.Map<java.lang.String,java.lang.String> params, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> bodies, java.util.Map<java.lang.String,java.lang.String> headers, NodeSelector nodeSelector)
Calls an elasticsearch api with the parameters and request body provided as arguments.void
clear()
Clears the last obtained response and the stashed fieldsVersion
esVersion()
Returns the current es version as a stringjava.lang.Object
response(java.lang.String path)
Extracts a specific value from the last saved responseStash
stash()
-
-
-
Method Detail
-
callApi
public ClientYamlTestResponse callApi(java.lang.String apiName, java.util.Map<java.lang.String,java.lang.String> params, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> bodies, java.util.Map<java.lang.String,java.lang.String> headers) throws java.io.IOException
Calls an elasticsearch api with the parameters and request body provided as arguments. Saves the obtained response in the execution context.- Throws:
java.io.IOException
-
callApi
public ClientYamlTestResponse callApi(java.lang.String apiName, java.util.Map<java.lang.String,java.lang.String> params, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> bodies, java.util.Map<java.lang.String,java.lang.String> headers, NodeSelector nodeSelector) throws java.io.IOException
Calls an elasticsearch api with the parameters and request body provided as arguments. Saves the obtained response in the execution context.- Throws:
java.io.IOException
-
response
public java.lang.Object response(java.lang.String path) throws java.io.IOException
Extracts a specific value from the last saved response- Throws:
java.io.IOException
-
clear
public void clear()
Clears the last obtained response and the stashed fields
-
stash
public Stash stash()
-
esVersion
public Version esVersion()
Returns the current es version as a string
-
-