WebSocketServerHandshakerFactory { public static ChannelFuture sendUnsupportedVersionResponse(Channel channel) { return sendUnsupportedVersionResponse(channel, channel.newPromise()); } WebSocketServerHandshakerFactory(
            String webSocketURL, String subprotocols, boolean allowExtensions);  WebSocketServerHandshakerFactory(
            String webSocketURL, String subprotocols, boolean allowExtensions,
            int maxFramePayloadLength);  WebSocketServerHandshakerFactory(
            String webSocketURL, String subprotocols, boolean allowExtensions,
            int maxFramePayloadLength, boolean allowMaskMismatch); WebSocketServerHandshaker newHandshaker(HttpRequest req); @Deprecated static void sendUnsupportedWebSocketVersionResponse(Channel channel); static ChannelFuture sendUnsupportedVersionResponse(Channel channel); static ChannelFuture sendUnsupportedVersionResponse(Channel channel, ChannelPromise promise);  }
@Test public void testUnsupportedVersion() throws Exception { EmbeddedChannel ch = new EmbeddedChannel(); WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ch); ch.runPendingTasks(); Object msg = ch.readOutbound(); if (!(msg instanceof FullHttpResponse)) { fail("Got wrong response " + msg); } FullHttpResponse response = (FullHttpResponse) msg; assertEquals(HttpResponseStatus.UPGRADE_REQUIRED, response.status()); assertEquals(WebSocketVersion.V13.toHttpHeaderValue(), response.headers().get(HttpHeaderNames.SEC_WEBSOCKET_VERSION)); assertTrue(HttpUtil.isContentLengthSet(response)); assertEquals(0, HttpUtil.getContentLength(response)); ReferenceCountUtil.release(response); assertFalse(ch.finish()); }