Skip to content

Commit

Permalink
Test loads brotli to do compression
Browse files Browse the repository at this point in the history
(cherry picked from commit 4174cce)
  • Loading branch information
Karm authored and gsmet committed Nov 12, 2024
1 parent cbc47ed commit dd35a81
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.zip.DeflaterOutputStream;
import java.util.zip.GZIPOutputStream;

import com.aayushatharva.brotli4j.Brotli4jLoader;
import com.aayushatharva.brotli4j.encoder.BrotliOutputStream;

import io.netty.buffer.ByteBuf;
Expand All @@ -39,6 +40,11 @@ public class Testflow {
// Vert.x/Netty versions over time.
public static final int COMPRESSION_TOLERANCE_PERCENT = 2;

static {
// Our test code does compression
Brotli4jLoader.ensureAvailability();
}

/**
* This test logic is shared by both "all" module and "some" module. See their RESTEndpointsTest classes.
*
Expand Down Expand Up @@ -121,6 +127,7 @@ public static void runDecompressorsTest(String endpoint, String acceptEncoding,
client.postAbs(endpoint)
.putHeader(HttpHeaders.CONTENT_ENCODING.toString(), contentEncoding)
.putHeader(HttpHeaders.ACCEPT.toString(), "*/*")
.putHeader(HttpHeaders.USER_AGENT.toString(), "Tester")
.sendBuffer(compress(contentEncoding, TEXT), ar -> {
if (ar.succeeded()) {
future.complete(ar.result());
Expand Down

0 comments on commit dd35a81

Please sign in to comment.