@Test
public void testHttpUpgradeRequest() throws Exception {

    EmbeddedChannel ch = createChannel(new MockOutboundHandler());
    ChannelHandlerContext handshakerCtx = ch.pipeline().context(WebSocketServerProtocolHandshakeHandler.class);
    writeUpgradeRequest(ch);
    FullHttpResponse response = responses.remove();
    assertEquals(SWITCHING_PROTOCOLS, response.status());
    response.release();
    assertNotNull(WebSocketServerProtocolHandler.getHandshaker(handshakerCtx.channel()));
}