public void testCodingFragmentBufferingLargeFragment() throws Exception {
final WritableByteChannelMock channel = Mockito.spy(new WritableByteChannelMock(64));
final SessionOutputBuffer outbuf = Mockito.spy(new SessionOutputBufferImpl(1024, 128));
final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
outbuf.writeLine("header");
final LengthDelimitedEncoder encoder = new LengthDelimitedEncoder(channel, outbuf, metrics,
100, 2);
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
Mockito.verify(channel, Mockito.times(2)).write(Mockito.<ByteBuffer>any());