Skip to content

Commit

Permalink
Test loads brotli to do compression
Browse files Browse the repository at this point in the history
  • Loading branch information
Karm committed Nov 11, 2024
1 parent 1aa2223 commit 4174cce
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 4174cce

Please sign in to comment.