public void testProduceOutputLongChunkedMessageSaturatedChannel() throws Exception {
conn = new DefaultNHttpServerConnection(session, 64);
final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
response.addHeader(HTTP.TRANSFER_ENCODING, HTTP.CHUNK_CODING);
final NStringEntity entity = new NStringEntity("a lot of various stuff");
entity.setChunked(true);
response.setEntity(entity);
final WritableByteChannelMock wchannel = Mockito.spy(new WritableByteChannelMock(64, 64));
final ByteChannelMock channel = new ByteChannelMock(null, wchannel);
Mockito.when(session.channel()).thenReturn(channel);