[TEST] create standard RestClient at first request and reuse it
A RestClient instance is now created whenever EsIntegTestCase#getRestClient is invoked for the first time. It is then kept until the cluster is cleared (depending on the cluster scope of the test). Renamed other two restClient methods to createRestClient, as that instance needs to be closed and managed in the tests.
This commit is contained in:
parent
23a94bb974
commit
c48b7a7a97
|
@ -219,7 +219,8 @@ public class ContextAndHeaderTransportIT extends ESIntegTestCase {
|
|||
restController.registerRelevantHeaders(relevantHeaderName);
|
||||
}
|
||||
|
||||
try (ElasticsearchResponse response = getRestClient().performRequest("GET", "/" + queryIndex + "/_search", Collections.emptyMap(), null,
|
||||
try (ElasticsearchResponse response = getRestClient().performRequest(
|
||||
"GET", "/" + queryIndex + "/_search", Collections.emptyMap(), null,
|
||||
new BasicHeader(randomHeaderKey, randomHeaderValue), new BasicHeader(relevantHeaderName, randomHeaderValue))) {
|
||||
assertThat(response, hasStatus(OK));
|
||||
List<RequestAndHeaders> searchRequests = getRequests(SearchRequest.class);
|
||||
|
|
Loading…
Reference in New Issue