Package org.elasticsearch.test.rest.yaml
Class ClientYamlTestExecutionContext
java.lang.Object
org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext
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 TypeMethodDescriptioncallApi
(String apiName, Map<String, String> params, List<Map<String, Object>> bodies, Map<String, String> headers) Calls an elasticsearch api with the parameters and request body provided as arguments.callApi
(String apiName, Map<String, String> params, List<Map<String, Object>> bodies, Map<String, 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 fieldsReturns the current es version as a stringos()
Extracts a specific value from the last saved responsestash()
-
Method Details
-
callApi
public ClientYamlTestResponse callApi(String apiName, Map<String, String> params, List<Map<String, throws IOExceptionObject>> bodies, Map<String, String> headers) Calls an elasticsearch api with the parameters and request body provided as arguments. Saves the obtained response in the execution context.- Throws:
IOException
-
callApi
public ClientYamlTestResponse callApi(String apiName, Map<String, String> params, List<Map<String, throws IOExceptionObject>> bodies, Map<String, String> headers, NodeSelector nodeSelector) Calls an elasticsearch api with the parameters and request body provided as arguments. Saves the obtained response in the execution context.- Throws:
IOException
-
response
Extracts a specific value from the last saved response- Throws:
IOException
-
clear
public void clear()Clears the last obtained response and the stashed fields -
stash
-
esVersion
Returns the current es version as a string -
masterVersion
-
os
-
getClientYamlTestCandidate
-