private static void webSocketTestTransport(final WebSocketVersion version) {
final String serviceName = "/echo";
final String sessionUrl = serviceName + "/222/" + UUID.randomUUID().toString();
final SockJsConfig config = SockJsConfig.withPrefix(serviceName).build();
final SockJsServiceFactory service = echoService(config);
final EmbeddedChannel ch = wsChannelForService(service);
final FullHttpRequest request = webSocketUpgradeRequest(sessionUrl + "/websocket", version);
ch.writeInbound(request);
// Discard the HTTP Response (this will be a ByteBuf and not an object
// as we have a HttpEncoder is in the pipeline to start with.
ch.readOutbound();
final TextWebSocketFrame openFrame = (TextWebSocketFrame) readOutboundDiscardEmpty(ch);
assertThat(openFrame.content().toString(UTF_8), equalTo("o"));
ch.readOutbound();
final TextWebSocketFrame textWebSocketFrame = new TextWebSocketFrame("\"a\"");
ch.writeInbound(textWebSocketFrame);
final TextWebSocketFrame textFrame = ch.readOutbound();
assertThat(textFrame.content().toString(UTF_8), equalTo("a[\"a\"]"));
}