mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 18:35:25 +00:00
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) {
|
} 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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user