Skip to content

Commit

Permalink
Issue #9554 - fix test expectations for hpack
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed May 4, 2023
1 parent 040ef10 commit 738ad78
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public void testHuffmanEncodedExtraPadding()
String encoded = "82868441" + "84" + "49509FFF";
ByteBuffer buffer = ByteBuffer.wrap(TypeUtil.fromHexString(encoded));
CompressionException ex = assertThrows(CompressionException.class, () -> decoder.decode(buffer));
assertThat(ex.getMessage(), Matchers.containsString("Bad termination"));
assertThat(ex.getMessage(), Matchers.containsString("bad_termination"));
}

/* 5.2.2: Sends a Huffman-encoded string literal representation padded by zero */
Expand All @@ -478,7 +478,7 @@ public void testHuffmanEncodedZeroPadding()
ByteBuffer buffer = ByteBuffer.wrap(TypeUtil.fromHexString(encoded));

CompressionException ex = assertThrows(CompressionException.class, () -> decoder.decode(buffer));
assertThat(ex.getMessage(), Matchers.containsString("Incorrect padding"));
assertThat(ex.getMessage(), Matchers.containsString("incorrect_padding"));
}

/* 5.2.3: Sends a Huffman-encoded string literal representation containing the EOS symbol */
Expand All @@ -491,7 +491,7 @@ public void testHuffmanEncodedWithEOS()
ByteBuffer buffer = ByteBuffer.wrap(TypeUtil.fromHexString(encoded));

CompressionException ex = assertThrows(CompressionException.class, () -> decoder.decode(buffer));
assertThat(ex.getMessage(), Matchers.containsString("EOS in content"));
assertThat(ex.getMessage(), Matchers.containsString("eos_in_content"));
}

@Test
Expand All @@ -503,7 +503,7 @@ public void testHuffmanEncodedOneIncompleteOctet()
ByteBuffer buffer = ByteBuffer.wrap(TypeUtil.fromHexString(encoded));

CompressionException ex = assertThrows(CompressionException.class, () -> decoder.decode(buffer));
assertThat(ex.getMessage(), Matchers.containsString("Bad termination"));
assertThat(ex.getMessage(), Matchers.containsString("bad_termination"));
}

@Test
Expand All @@ -515,7 +515,7 @@ public void testHuffmanEncodedTwoIncompleteOctet()
ByteBuffer buffer = ByteBuffer.wrap(TypeUtil.fromHexString(encoded));

CompressionException ex = assertThrows(CompressionException.class, () -> decoder.decode(buffer));
assertThat(ex.getMessage(), Matchers.containsString("Bad termination"));
assertThat(ex.getMessage(), Matchers.containsString("bad_termination"));
}

@Test
Expand Down

0 comments on commit 738ad78

Please sign in to comment.