@Test
public void headersWriteShouldHalfClosePushStream() throws Exception {

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