@Test
public void shouldPassBytesFromInputStreamToParser() throws Exception
{

    mockery.checking(new Expectations()
    {
        {
            ignoring(connectionObserver).connectionClosed();
            allowing(readableByteChannel).isOpen();
            will(returnValue(false));
            one(readableByteChannel).read(with(any(ByteBuffer.class)));
            will(returnValue(1));
            one(readableByteChannel).read(with(any(ByteBuffer.class)));
            will(returnValue(-1));
            one(byteStreamMessageParser).parse(with(any(ByteBuffer.class)));
        }
    });
    //when
    inputStreamReader.blockingStart(readableByteChannel);
}