Http2RstStreamFrame extends Http2Frame { public long getErrorCode() { return errorCode; } protected  Http2RstStreamFrame(Http2RstStreamFrameBuilder builder); long getErrorCode(); @Override void writePayload(ByteBuffer buffer);  }
@Test public void decodeNoExtraPayload() { Http2Connection connection = new Http2Connection(); ByteBuffer buffer = ByteBuffer.wrap(TestMessages.RST_STREAM_NO_EXTRA_PAYLOAD_BUFFER); Http2RstStreamFrame frame = (Http2RstStreamFrame) connection.decode(buffer); assertNotNull(frame); assertEquals(4, frame.getLength()); assertEquals(3, frame.getType()); assertEquals(0x00, frame.getFlags()); assertEquals(32, frame.getStreamID()); assertEquals(256, frame.getErrorCode()); }
@Test public void decodeHighestValueNoExtraPayload() { Http2Connection connection = new Http2Connection(); ByteBuffer buffer = ByteBuffer.wrap(TestMessages.RST_STREAM_HIGHEST_VALUE_NO_EXTRA_PAYLOAD_BUFFER); Http2RstStreamFrame frame = (Http2RstStreamFrame) connection.decode(buffer); assertNotNull(frame); assertEquals(4, frame.getLength()); assertEquals(3, frame.getType()); assertEquals(0x00, frame.getFlags()); assertEquals(32, frame.getStreamID()); assertEquals(0x00FFFFFFFFL, frame.getErrorCode()); }
@Test public void decodeExtraPayload() { Http2Connection connection = new Http2Connection(); ByteBuffer buffer = ByteBuffer.wrap(TestMessages.RST_STREAM_EXTRA_PAYLOAD_BUFFER); Http2RstStreamFrame frame = (Http2RstStreamFrame) connection.decode(buffer); assertNotNull(frame); assertEquals(6, frame.getLength()); assertEquals(3, frame.getType()); assertEquals(0x00, frame.getFlags()); assertEquals(32, frame.getStreamID()); assertEquals(256, frame.getErrorCode()); }
@Test public void decodeHighestValueExtraPayload() { Http2Connection connection = new Http2Connection(); ByteBuffer buffer = ByteBuffer.wrap(TestMessages.RST_STREAM_EXTRA_PAYLOAD_HIGHEST_BUFFER); Http2RstStreamFrame frame = (Http2RstStreamFrame) connection.decode(buffer); assertNotNull(frame); assertEquals(6, frame.getLength()); assertEquals(3, frame.getType()); assertEquals(0x00, frame.getFlags()); assertEquals(32, frame.getStreamID()); assertEquals(0x00FFFFFFFFL, frame.getErrorCode()); }