@Test
public void dataWriteShouldSucceed() throws Exception {

    createStream(STREAM_ID, false);
    final ByteBuf data = dummyData();
    ChannelPromise p = newPromise();
    encoder.writeData(ctx, STREAM_ID, data, 0, true, p);
    assertEquals(8, payloadCaptor.getValue().size());
    payloadCaptor.getValue().write(ctx, 8);
    assertEquals(0, payloadCaptor.getValue().size());
    assertEquals("abcdefgh", writtenData.get(0));
    assertEquals(0, data.refCnt());
    assertTrue(p.isSuccess());
}