Http2ContinuationFrame extends Http2Frame { public byte[] getHeaderBlockFragment() { return headerBlockFragment; } protected  Http2ContinuationFrame(Http2ContinuationFrameBuilder builder); byte[] getHeaderBlockFragment(); @Override void writePayload(ByteBuffer buffer);  }
@Test public void decodeNoHeaderFragment() { Http2Connection connection = new Http2Connection(); ByteBuffer buffer = ByteBuffer.wrap(TestMessages.CONTINUATION_NO_HEADER_FRAGMENT_BUFFER); Http2ContinuationFrame frame = (Http2ContinuationFrame) connection.decode(buffer); assertNotNull(frame); assertEquals(0, frame.getLength()); assertEquals(9, frame.getType()); assertEquals(0x00, frame.getFlags()); assertEquals(50, frame.getStreamID()); assertEquals(0, frame.getHeaderBlockFragment().length); }
@Test public void decodeHeaderFragment() { Http2Connection connection = new Http2Connection(); ByteBuffer buffer = ByteBuffer.wrap(TestMessages.CONTINUATION_HEADER_FRAGMENT_BUFFER); Http2ContinuationFrame frame = (Http2ContinuationFrame) connection.decode(buffer); assertNotNull(frame); assertEquals(10, frame.getLength()); assertEquals(9, frame.getType()); assertEquals(0x00, frame.getFlags()); assertEquals(50, frame.getStreamID()); assertEquals(10, frame.getHeaderBlockFragment().length); assertArrayEquals(new byte[] {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A}, frame.getHeaderBlockFragment()); }