public ChannelFuture handshake(Channel channel) {
        ObjectUtil.checkNotNull(channel, "channel");
        return handshake(channel, channel.newPromise());
    }
@Test
    public void testInvalidOriginWhenIncorrectWebSocketURI() {
        URI uri = URI.create("/ws");
        EmbeddedChannel channel = new EmbeddedChannel(new HttpClientCodec());
        HttpHeaders headers = new DefaultHttpHeaders();
        headers.set(HttpHeaderNames.HOST, "localhost:80");
        final WebSocketClientHandshaker handshaker = newHandshaker(uri, null, headers, false, true);
        final ChannelFuture handshakeFuture = handshaker.handshake(channel);

        assertFalse(handshakeFuture.isSuccess());
        assertInstanceOf(IllegalArgumentException.class, handshakeFuture.cause());
        assertEquals("Cannot generate the '" + getOriginHeaderName() + "' header value," +
                     " webSocketURI should contain host or disable generateOriginHeader" +
                     " or pass value through customHeaders", handshakeFuture.cause().getMessage());
        assertFalse(channel.finish());
    }