@Test
public void writeHeadersWithPadding() throws Exception {

    int streamId = 1;
    Http2Headers headers = new DefaultHttp2Headers()
            .method("GET").path("/").authority("foo.com").scheme("https");
    frameWriter.writeHeaders(ctx, streamId, headers, 5, true, promise);
    byte[] expectedPayload = headerPayload(streamId, headers, (byte) 4);
    byte[] expectedFrameBytes = {
            (byte) 0x00, (byte) 0x00, (byte) 0x0f, // payload length = 16
            (byte) 0x01, // payload type = 1
            (byte) 0x0d, // flags = (0x01 | 0x04 | 0x08)
            (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 // stream id = 1
    };
    expectedOutbound = Unpooled.copiedBuffer(expectedFrameBytes, expectedPayload);
    assertEquals(expectedOutbound, outbound);
}