### Question:
WebSocketServerProtocolHandler extends SimpleChannelUpstreamHandler implements
    LifeCycleAwareChannelHandler { static WebSocketServerHandshaker getHandshaker(ChannelHandlerContext ctx) { return (WebSocketServerHandshaker) ctx.getAttachment(); } WebSocketServerProtocolHandler(String websocketPath);  WebSocketServerProtocolHandler(String websocketPath, String subprotocols);  WebSocketServerProtocolHandler(String websocketPath, String subprotocols, boolean allowExtensions); void afterAdd(ChannelHandlerContext ctx); @Override void messageReceived(ChannelHandlerContext ctx, MessageEvent e); @Override void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e); void beforeAdd(ChannelHandlerContext ctx); void beforeRemove(ChannelHandlerContext ctx); void afterRemove(ChannelHandlerContext ctx);  }### Answer:
@Test public void testHttpUpgradeRequest() { DecoderEmbedder<Object> embedder = decoderEmbedder(); ChannelHandlerContext ctx = embedder.getPipeline().getContext(WebSocketServerProtocolHandshakeHandler.class); HttpResponseInterceptor responseInterceptor = addHttpResponseInterceptor(embedder); embedder.offer(WebSocketRequestBuilder.sucessful()); HttpResponse response = responseInterceptor.getHttpResponse(); assertEquals(SWITCHING_PROTOCOLS, response.getStatus()); assertNotNull(WebSocketServerProtocolHandler.getHandshaker(ctx)); }