Skip to content

Instantly share code, notes, and snippets.

@vietj
Created August 23, 2019 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vietj/9c485ca24bdc3270b520ec46c926c324 to your computer and use it in GitHub Desktop.
Save vietj/9c485ca24bdc3270b520ec46c926c324 to your computer and use it in GitHub Desktop.
@Test
public void testCloseHandlerWhenConnectionEnds() throws Exception {
server.requestHandler(req -> {
req.response().closeHandler(v -> {
testComplete();
});
req.response().setChunked(true).write("some-data");
});
startServer(testAddress);
client.request(HttpMethod.GET, testAddress, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath", resp -> {
resp.handler(v -> {
resp.request().connection().close();
});
}).end();
await();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment