rename ElasticsearchResponse#getFirstHeader to getHeader
Original commit: elastic/x-pack-elasticsearch@8ca2f6d6dd
This commit is contained in:
parent
e240ca8043
commit
db27d0ab20
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue