From 1befae89aa1bc4605132b06618afc6a43efa3fa4 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 11 Jul 2022 10:26:12 +0200 Subject: [PATCH] Only enable test if brotli is there (#12592) Motiviation: We should only try to run the test if Brotli is really supported on the platform (which is not the case on m1) Modifications: Only run if brotli is supported Result: Testsuite pass on m1 --- .../codec/http/HttpContentCompressorOptionsTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorOptionsTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorOptionsTest.java index 285be33f50c..4d955cf048e 100644 --- a/codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorOptionsTest.java +++ b/codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorOptionsTest.java @@ -16,9 +16,11 @@ package io.netty.handler.codec.http; import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.handler.codec.compression.Brotli; import io.netty.handler.codec.compression.StandardCompressionOptions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIf; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; @@ -28,8 +30,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +@EnabledIf("isBrotiAvailable") class HttpContentCompressorOptionsTest { + static boolean isBrotiAvailable() { + return Brotli.isAvailable(); + } + @Test void testGetBrTargetContentEncoding() { HttpContentCompressor compressor = new HttpContentCompressor(