mirror of
https://github.com/google/nomulus.git
synced 2025-07-24 19:48:32 +02:00
Add an HTTP header to response from Nomulus after successful login (#879)
* Add a logged-in response header * small fixes * Refactor EPP test cases to check for headers * small change
This commit is contained in:
parent
f92819243d
commit
b0fad6c87b
7 changed files with 96 additions and 12 deletions
|
@ -249,6 +249,20 @@ class EppServiceHandlerTest {
|
|||
assertThat(channel.isActive()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void sendResponseToNextHandler_unrecognizedHeader() throws Exception {
|
||||
setHandshakeSuccess();
|
||||
String content = "<epp>stuff</epp>";
|
||||
HttpResponse response = makeEppHttpResponse(content, HttpResponseStatus.OK);
|
||||
response.headers().set("unrecognized-header", "test");
|
||||
channel.writeOutbound(response);
|
||||
ByteBuf expectedResponse = channel.readOutbound();
|
||||
assertThat(Unpooled.wrappedBuffer(content.getBytes(UTF_8))).isEqualTo(expectedResponse);
|
||||
// Nothing further to pass to the next handler.
|
||||
assertThat((Object) channel.readOutbound()).isNull();
|
||||
assertThat(channel.isActive()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_disconnectOnNonOKResponseStatus() throws Exception {
|
||||
setHandshakeSuccess();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue