public class RestTestExecutionContext
extends java.lang.Object
implements java.io.Closeable
| Constructor and Description |
|---|
RestTestExecutionContext(RestSpec restSpec) |
| Modifier and Type | Method and Description |
|---|---|
RestTestResponse |
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.
|
void |
clear()
Clears the last obtained response and the stashed fields
|
void |
close()
Closes the execution context and releases the underlying resources
|
org.elasticsearch.Version |
esVersion()
Returns the current es version as a string
|
void |
initClient(java.net.URL[] urls,
org.elasticsearch.common.settings.Settings settings)
Creates the embedded REST client when needed.
|
java.lang.Object |
response(java.lang.String path)
Extracts a specific value from the last saved response
|
Stash |
stash() |
public RestTestExecutionContext(RestSpec restSpec)
public RestTestResponse 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
java.io.IOExceptionpublic java.lang.Object response(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic void initClient(java.net.URL[] urls,
org.elasticsearch.common.settings.Settings settings)
throws java.io.IOException
java.io.IOExceptionpublic void clear()
public Stash stash()
public org.elasticsearch.Version esVersion()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseable