assertThat(response.getStatus(), equalTo(HttpResponseStatus.OK));
assertThat(response.headers().get(CONTENT_TYPE), equalTo(Transports.CONTENT_TYPE_JAVASCRIPT));
SockJsTestUtil.assertCORSHeaders(response, "*");
SockJsTestUtil.verifyNoCacheHeaders(response);
final DefaultHttpContent prelude = ch.readOutbound();
assertThat(prelude.content().readableBytes(), is(PreludeFrame.CONTENT_SIZE + 1));
final ByteBuf buffer = Unpooled.buffer(PreludeFrame.CONTENT_SIZE + 1);
prelude.content().readBytes(buffer);
buffer.release();
final DefaultHttpContent openResponse = ch.readOutbound();
assertThat(openResponse.content().toString(UTF_8), equalTo("o\n"));
final FullHttpResponse validSend = xhrSendRequest(sessionUrl, "[\"x\"]", serviceFactory);
assertThat(validSend.getStatus(), is(HttpResponseStatus.NO_CONTENT));
final DefaultHttpContent chunk = ch.readOutbound();
assertThat(chunk.content().toString(UTF_8), equalTo("a[\"x\"]\n"));
}