diff --git a/elasticsearch/qa/shield-example-realm/src/test/java/org/elasticsearch/example/realm/CustomRealmIT.java b/elasticsearch/qa/shield-example-realm/src/test/java/org/elasticsearch/example/realm/CustomRealmIT.java index 8bbaf98c7ef..ac0b4d3b6a6 100644 --- a/elasticsearch/qa/shield-example-realm/src/test/java/org/elasticsearch/example/realm/CustomRealmIT.java +++ b/elasticsearch/qa/shield-example-realm/src/test/java/org/elasticsearch/example/realm/CustomRealmIT.java @@ -52,7 +52,7 @@ public class CustomRealmIT extends ESIntegTestCase { } catch(ElasticsearchResponseException e) { ElasticsearchResponse response = e.getElasticsearchResponse(); assertThat(response.getStatusLine().getStatusCode(), is(401)); - String value = response.getFirstHeader("WWW-Authenticate"); + String value = response.getHeader("WWW-Authenticate"); assertThat(value, is("custom-challenge")); } } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/user/AnonymousUserIntegTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/user/AnonymousUserIntegTests.java index 7e591237221..b3446289985 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/user/AnonymousUserIntegTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/user/AnonymousUserIntegTests.java @@ -50,12 +50,12 @@ public class AnonymousUserIntegTests extends ShieldIntegTestCase { ElasticsearchResponse response = e.getElasticsearchResponse(); if (authorizationExceptionsEnabled) { assertThat(statusCode, is(403)); - assertThat(response.getFirstHeader("WWW-Authenticate"), nullValue()); + assertThat(response.getHeader("WWW-Authenticate"), nullValue()); assertThat(e.getResponseBody(), containsString("security_exception")); } else { assertThat(statusCode, is(401)); - assertThat(response.getFirstHeader("WWW-Authenticate"), notNullValue()); - assertThat(response.getFirstHeader("WWW-Authenticate"), containsString("Basic")); + assertThat(response.getHeader("WWW-Authenticate"), notNullValue()); + assertThat(response.getHeader("WWW-Authenticate"), containsString("Basic")); assertThat(e.getResponseBody(), containsString("security_exception")); } }