final String msg = generateMessage(128);
for (int i = 0; i < 31; i++) {
final FullHttpResponse validSend = xhrSendRequest(sessionUrl, "[\"" + msg + "\"]", echoFactory);
assertThat(validSend.getStatus(), is(HttpResponseStatus.NO_CONTENT));
final DefaultHttpContent chunk = ch.readOutbound();
assertThat(chunk.content().toString(UTF_8), equalTo("a[\"" + msg + "\"]\n"));
}
final LastHttpContent lastChunk = ch.readOutbound();
assertThat(lastChunk.content().readableBytes(), is(0));
assertThat(ch.isOpen(), is(false));
}