@Test
public void headersWriteShouldOpenStreamForPush() throws Exception {

    writeAllFlowControlledFrames();
    Http2Stream parent = createStream(STREAM_ID, false);
    reservePushStream(PUSH_STREAM_ID, parent);
    ChannelPromise promise = newPromise();
    encoder.writeHeaders(ctx, PUSH_STREAM_ID, EmptyHttp2Headers.INSTANCE, 0, false, promise);
    assertEquals(HALF_CLOSED_REMOTE, stream(PUSH_STREAM_ID).state());
    verify(writer).writeHeaders(eq(ctx), eq(PUSH_STREAM_ID), eq(EmptyHttp2Headers.INSTANCE), eq(0),
            eq(DEFAULT_PRIORITY_WEIGHT), eq(false), eq(0), eq(false), eq(promise));
}