@Test
public void encoderDelegatesGoAwayToLifeCycleManager() {

    ChannelPromise promise = newPromise();
    encoder.writeGoAway(ctx, STREAM_ID, Http2Error.INTERNAL_ERROR.code(), null, promise);
    verify(lifecycleManager).goAway(eq(ctx), eq(STREAM_ID), eq(Http2Error.INTERNAL_ERROR.code()),
            eq((ByteBuf) null), eq(promise));
    verifyNoMoreInteractions(writer);
}