diff --git a/elasticsearch/qa/smoke-test-plugins-ssl/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsSslIT.java b/elasticsearch/qa/smoke-test-plugins-ssl/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsSslIT.java index 17878a9e51f..50027ae656a 100644 --- a/elasticsearch/qa/smoke-test-plugins-ssl/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsSslIT.java +++ b/elasticsearch/qa/smoke-test-plugins-ssl/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsSslIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.client.RestClient; +import org.elasticsearch.test.rest.client.RestTestClient; import org.elasticsearch.test.rest.parser.RestTestParseException; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -65,9 +65,9 @@ public class SmokeTestPluginsSslIT extends ESRestTestCase { String token = basicAuthHeaderValue(USER, new SecuredString(PASS.toCharArray())); return Settings.builder() .put(ThreadContext.PREFIX + ".Authorization", token) - .put(RestClient.PROTOCOL, "https") - .put(RestClient.TRUSTSTORE_PATH, keyStore) - .put(RestClient.TRUSTSTORE_PASSWORD, KEYSTORE_PASS) + .put(RestTestClient.PROTOCOL, "https") + .put(RestTestClient.TRUSTSTORE_PATH, keyStore) + .put(RestTestClient.TRUSTSTORE_PASSWORD, KEYSTORE_PASS) .build(); } } diff --git a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java index 675834e9245..5bda0f4e9c0 100644 --- a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java +++ b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java @@ -5,15 +5,6 @@ */ package org.elasticsearch.xpack.test.rest; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URI; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.List; -import java.util.Map; - import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.apache.http.client.methods.CloseableHttpResponse; @@ -40,9 +31,19 @@ import org.elasticsearch.test.rest.parser.RestTestParseException; import org.junit.After; import org.junit.Before; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.List; +import java.util.Map; + import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.is; + public abstract class XPackRestTestCase extends ESRestTestCase { private static final String BASIC_AUTH_VALUE = basicAuthHeaderValue("test_user", new SecuredString("changeme".toCharArray())); @@ -101,6 +102,7 @@ public abstract class XPackRestTestCase extends ESRestTestCase { @After public void clearShieldUsersAndRoles() throws Exception { + //TODO change this to use RestClient, also look for usages of HttpClient directly // we cannot delete the .security index from a rest test since we aren't the internal user, lets wipe the data // TODO remove this once the built-in SUPERUSER role is added that can delete the index and we use the built in admin user here try (CloseableHttpClient client = HttpClients.createMinimal(new BasicHttpClientConnectionManager())) {