@Test public void writeHeadersNotEndStream() throws Exception { int streamId = 1; Http2Headers headers = new DefaultHttp2Headers() .method("GET").path("/").authority("foo.com").scheme("https"); frameWriter.writeHeaders(ctx, streamId, headers, 0, false, promise); byte[] expectedPayload = headerPayload(streamId, headers); byte[] expectedFrameBytes = { (byte) 0x00, (byte) 0x00, (byte) 0x0a, (byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 }; ByteBuf expectedOutbound = Unpooled.copiedBuffer(expectedFrameBytes, expectedPayload); assertEquals(expectedOutbound, outbound); }
@Override public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise) { return writeHeadersInternal(ctx, streamId, headers, padding, endStream, false, 0, (short) 0, false, promise); }
DefaultHttp2FrameWriter implements Http2FrameWriter, Http2FrameSizePolicy, Configuration { @Override public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise) { return writeHeadersInternal(ctx, streamId, headers, padding, endStream, false, 0, (short) 0, false, promise); } }
DefaultHttp2FrameWriter implements Http2FrameWriter, Http2FrameSizePolicy, Configuration { @Override public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise) { return writeHeadersInternal(ctx, streamId, headers, padding, endStream, false, 0, (short) 0, false, promise); } DefaultHttp2FrameWriter();  DefaultHttp2FrameWriter(SensitivityDetector headersSensitivityDetector);  DefaultHttp2FrameWriter(SensitivityDetector headersSensitivityDetector, boolean ignoreMaxHeaderListSize);  DefaultHttp2FrameWriter(Http2HeadersEncoder headersEncoder); }
DefaultHttp2FrameWriter implements Http2FrameWriter, Http2FrameSizePolicy, Configuration { @Override public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise) { return writeHeadersInternal(ctx, streamId, headers, padding, endStream, false, 0, (short) 0, false, promise); } DefaultHttp2FrameWriter();  DefaultHttp2FrameWriter(SensitivityDetector headersSensitivityDetector);  DefaultHttp2FrameWriter(SensitivityDetector headersSensitivityDetector, boolean ignoreMaxHeaderListSize);  DefaultHttp2FrameWriter(Http2HeadersEncoder headersEncoder); @Override Configuration configuration(); @Override Http2HeadersEncoder.Configuration headersConfiguration(); @Override Http2FrameSizePolicy frameSizePolicy(); @Override void maxFrameSize(int max); @Override int maxFrameSize(); @Override void close(); @Override ChannelFuture writeData(ChannelHandlerContext ctx, int streamId, ByteBuf data,
            int padding, boolean endStream, ChannelPromise promise); @Override ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId,
            Http2Headers headers, int padding, boolean endStream, ChannelPromise promise); @Override ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId,
            Http2Headers headers, int streamDependency, short weight, boolean exclusive,
            int padding, boolean endStream, ChannelPromise promise); @Override ChannelFuture writePriority(ChannelHandlerContext ctx, int streamId,
            int streamDependency, short weight, boolean exclusive, ChannelPromise promise); @Override ChannelFuture writeRstStream(ChannelHandlerContext ctx, int streamId, long errorCode,
            ChannelPromise promise); @Override ChannelFuture writeSettings(ChannelHandlerContext ctx, Http2Settings settings,
            ChannelPromise promise); @Override ChannelFuture writeSettingsAck(ChannelHandlerContext ctx, ChannelPromise promise); @Override ChannelFuture writePing(ChannelHandlerContext ctx, boolean ack, long data, ChannelPromise promise); @Override ChannelFuture writePushPromise(ChannelHandlerContext ctx, int streamId,
            int promisedStreamId, Http2Headers headers, int padding, ChannelPromise promise); @Override ChannelFuture writeGoAway(ChannelHandlerContext ctx, int lastStreamId, long errorCode,
            ByteBuf debugData, ChannelPromise promise); @Override ChannelFuture writeWindowUpdate(ChannelHandlerContext ctx, int streamId,
            int windowSizeIncrement, ChannelPromise promise); @Override ChannelFuture writeFrame(ChannelHandlerContext ctx, byte frameType, int streamId,
            Http2Flags flags, ByteBuf payload, ChannelPromise promise); }
DefaultHttp2FrameWriter implements Http2FrameWriter, Http2FrameSizePolicy, Configuration { @Override public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise) { return writeHeadersInternal(ctx, streamId, headers, padding, endStream, false, 0, (short) 0, false, promise); } DefaultHttp2FrameWriter();  DefaultHttp2FrameWriter(SensitivityDetector headersSensitivityDetector);  DefaultHttp2FrameWriter(SensitivityDetector headersSensitivityDetector, boolean ignoreMaxHeaderListSize);  DefaultHttp2FrameWriter(Http2HeadersEncoder headersEncoder); @Override Configuration configuration(); @Override Http2HeadersEncoder.Configuration headersConfiguration(); @Override Http2FrameSizePolicy frameSizePolicy(); @Override void maxFrameSize(int max); @Override int maxFrameSize(); @Override void close(); @Override ChannelFuture writeData(ChannelHandlerContext ctx, int streamId, ByteBuf data,
            int padding, boolean endStream, ChannelPromise promise); @Override ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId,
            Http2Headers headers, int padding, boolean endStream, ChannelPromise promise); @Override ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId,
            Http2Headers headers, int streamDependency, short weight, boolean exclusive,
            int padding, boolean endStream, ChannelPromise promise); @Override ChannelFuture writePriority(ChannelHandlerContext ctx, int streamId,
            int streamDependency, short weight, boolean exclusive, ChannelPromise promise); @Override ChannelFuture writeRstStream(ChannelHandlerContext ctx, int streamId, long errorCode,
            ChannelPromise promise); @Override ChannelFuture writeSettings(ChannelHandlerContext ctx, Http2Settings settings,
            ChannelPromise promise); @Override ChannelFuture writeSettingsAck(ChannelHandlerContext ctx, ChannelPromise promise); @Override ChannelFuture writePing(ChannelHandlerContext ctx, boolean ack, long data, ChannelPromise promise); @Override ChannelFuture writePushPromise(ChannelHandlerContext ctx, int streamId,
            int promisedStreamId, Http2Headers headers, int padding, ChannelPromise promise); @Override ChannelFuture writeGoAway(ChannelHandlerContext ctx, int lastStreamId, long errorCode,
            ByteBuf debugData, ChannelPromise promise); @Override ChannelFuture writeWindowUpdate(ChannelHandlerContext ctx, int streamId,
            int windowSizeIncrement, ChannelPromise promise); @Override ChannelFuture writeFrame(ChannelHandlerContext ctx, byte frameType, int streamId,
            Http2Flags flags, ByteBuf payload, ChannelPromise promise);  }