public void testWriteEmptyFile() throws Exception {
AbstractStreamWriteFilter<M> filter = createFilter();
M message = createMessage(new byte[0]);
WriteRequest writeRequest = new DefaultWriteRequest(message,
new DummyWriteFuture());
NextFilter nextFilter = EasyMock.createMock(NextFilter.class);
/*
* Record expectations
*/
nextFilter.messageSent(session, writeRequest);
/*
* Replay.
*/
EasyMock.replay(nextFilter);
filter.filterWrite(nextFilter, session, writeRequest);
/*
* Verify.
*/
EasyMock.verify(nextFilter);
assertTrue(writeRequest.getFuture().isWritten());
}