Skip to content

Commit

Permalink
Only enable test if brotli is there (#12592)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
normanmaurer committed Jul 11, 2022
1 parent 953c00c commit 367697d
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -16,8 +16,10 @@
package io.netty5.handler.codec.http;

import io.netty5.channel.embedded.EmbeddedChannel;
import io.netty5.handler.codec.compression.Brotli;
import io.netty5.handler.codec.compression.StandardCompressionOptions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIf;

import static io.netty5.buffer.api.DefaultBufferAllocators.preferredAllocator;
import static org.hamcrest.CoreMatchers.instanceOf;
Expand All @@ -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(
Expand Down

0 comments on commit 367697d

Please sign in to comment.