rename ElasticsearchResponse#getFirstHeader to getHeader

Original commit: elastic/x-pack-elasticsearch@8ca2f6d6dd
This commit is contained in:
javanna 2016-06-03 18:28:45 +02:00 committed by Luca Cavanna
parent e240ca8043
commit db27d0ab20
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ public class CustomRealmIT extends ESIntegTestCase {
} catch(ElasticsearchResponseException e) { } catch(ElasticsearchResponseException e) {
ElasticsearchResponse response = e.getElasticsearchResponse(); ElasticsearchResponse response = e.getElasticsearchResponse();
assertThat(response.getStatusLine().getStatusCode(), is(401)); assertThat(response.getStatusLine().getStatusCode(), is(401));
String value = response.getFirstHeader("WWW-Authenticate"); String value = response.getHeader("WWW-Authenticate");
assertThat(value, is("custom-challenge")); assertThat(value, is("custom-challenge"));
} }
} }

View File

@ -50,12 +50,12 @@ public class AnonymousUserIntegTests extends ShieldIntegTestCase {
ElasticsearchResponse response = e.getElasticsearchResponse(); ElasticsearchResponse response = e.getElasticsearchResponse();
if (authorizationExceptionsEnabled) { if (authorizationExceptionsEnabled) {
assertThat(statusCode, is(403)); assertThat(statusCode, is(403));
assertThat(response.getFirstHeader("WWW-Authenticate"), nullValue()); assertThat(response.getHeader("WWW-Authenticate"), nullValue());
assertThat(e.getResponseBody(), containsString("security_exception")); assertThat(e.getResponseBody(), containsString("security_exception"));
} else { } else {
assertThat(statusCode, is(401)); assertThat(statusCode, is(401));
assertThat(response.getFirstHeader("WWW-Authenticate"), notNullValue()); assertThat(response.getHeader("WWW-Authenticate"), notNullValue());
assertThat(response.getFirstHeader("WWW-Authenticate"), containsString("Basic")); assertThat(response.getHeader("WWW-Authenticate"), containsString("Basic"));
assertThat(e.getResponseBody(), containsString("security_exception")); assertThat(e.getResponseBody(), containsString("security_exception"));
} }
} }