@Test
public void writeHeaders() throws Exception {

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