[TEST] remove usage of deprecated apis

Original commit: elastic/x-pack-elasticsearch@4f4af3f5c5
This commit is contained in:
javanna 2016-06-03 17:09:43 +02:00 committed by Luca Cavanna
parent ad9a64e854
commit 601169833b
2 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ public class PkiOptionalClientAuthTests extends ShieldIntegTestCase {
} }
public void testRestClientWithoutClientCertificate() throws Exception { public void testRestClientWithoutClientCertificate() throws Exception {
CloseableHttpClient httpClient = HttpClients.custom().setSslcontext(getSSLContext()).build(); CloseableHttpClient httpClient = HttpClients.custom().setSSLContext(getSSLContext()).build();
try (RestClient restClient = restClient(httpClient, "https")) { try (RestClient restClient = restClient(httpClient, "https")) {
try { try {
restClient.performRequest("GET", "_nodes", Collections.emptyMap(), null); restClient.performRequest("GET", "_nodes", Collections.emptyMap(), null);

View File

@ -79,7 +79,7 @@ public class PkiWithoutClientAuthenticationTests extends ShieldIntegTestCase {
public void testThatHttpWorks() throws Exception { public void testThatHttpWorks() throws Exception {
SSLContext sc = SSLContext.getInstance("SSL"); SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new SecureRandom()); sc.init(null, trustAllCerts, new SecureRandom());
CloseableHttpClient httpClient = HttpClients.custom().setSslcontext(sc).build(); CloseableHttpClient httpClient = HttpClients.custom().setSSLContext(sc).build();
try (RestClient restClient = restClient(httpClient, "https")) { try (RestClient restClient = restClient(httpClient, "https")) {
try (ElasticsearchResponse response = restClient.performRequest("GET", "/_nodes", Collections.emptyMap(), null, try (ElasticsearchResponse response = restClient.performRequest("GET", "/_nodes", Collections.emptyMap(), null,
new BasicHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, new BasicHeader(UsernamePasswordToken.BASIC_AUTH_HEADER,