final SockJsServiceFactory echoFactory = echoService();
final String sessionUrl = echoFactory.config().prefix() + "/222/" + UUID.randomUUID().toString();
final EmbeddedChannel ch = channelForService(echoFactory);
removeLastInboundMessageHandlers(ch);
final FullHttpRequest request = webSocketUpgradeRequest(sessionUrl + "/websocket");
request.headers().set(UPGRADE, "websocket");
request.headers().set(CONNECTION, "close");
ch.writeInbound(request);
final FullHttpResponse response = ch.readOutbound();
assertThat(response.getStatus(), equalTo(HttpResponseStatus.BAD_REQUEST));
assertThat(response.content().toString(UTF_8), equalTo("\"Connection\" must be \"Upgrade\"."));
}