diff --git a/jetty-http3/http3-qpack/src/test/java/org/eclipse/jetty/http3/qpack/SectionAcknowledgmentTest.java b/jetty-http3/http3-qpack/src/test/java/org/eclipse/jetty/http3/qpack/SectionAcknowledgmentTest.java index b0446f304fdf..bc2eda81ce68 100644 --- a/jetty-http3/http3-qpack/src/test/java/org/eclipse/jetty/http3/qpack/SectionAcknowledgmentTest.java +++ b/jetty-http3/http3-qpack/src/test/java/org/eclipse/jetty/http3/qpack/SectionAcknowledgmentTest.java @@ -15,6 +15,7 @@ import java.nio.ByteBuffer; +import org.eclipse.jetty.http3.qpack.QpackException.SessionException; import org.eclipse.jetty.http3.qpack.internal.instruction.SectionAcknowledgmentInstruction; import org.eclipse.jetty.util.BufferUtil; import org.junit.jupiter.api.BeforeEach; @@ -25,6 +26,8 @@ import static org.eclipse.jetty.http3.qpack.QpackTestUtil.toMetaData; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -68,12 +71,13 @@ public void testSectionAcknowledgmentForZeroRequiredInsertCountOnEncoder() throw { // Encode a header with only a value contained in the static table. ByteBuffer buffer = encode(_encoder, 0, toMetaData("GET", "/", "http")); - System.err.println(BufferUtil.toDetailString(buffer)); + assertThat(BufferUtil.remaining(buffer), greaterThan(0L)); // Parsing a section ack instruction on the encoder when we are not expecting it should result in QPACK_DECODER_STREAM_ERROR. SectionAcknowledgmentInstruction instruction = new SectionAcknowledgmentInstruction(0); ByteBuffer instructionBuffer = toBuffer(instruction); - QpackException error = assertThrows(QpackException.class, () -> _encoder.parseInstructions(instructionBuffer)); + SessionException error = assertThrows(SessionException.class, () -> _encoder.parseInstructions(instructionBuffer)); + assertThat(error.getErrorCode(), equalTo(QpackException.QPACK_ENCODER_STREAM_ERROR)); assertThat(error.getMessage(), containsString("No StreamInfo for 0")); } }