JerseyClientExample { public String downloadFileAsString(String fileUrl) { JerseyClient client = new JerseyClientBuilder() .register(BrotliEncoder.class) .build(); return client.target(fileUrl) .request() .acceptEncoding("br") .get(String.class); }  String downloadFileAsString(String fileUrl);  }
@Test public void brotli_downloads_can_be_decompressed_via_apache_jerseyclient() throws IOException, HttpException { JerseyClientExample jerseyClient = new JerseyClientExample(); String text = jerseyClient.downloadFileAsString(indexHtmlUrl); assertThat(text).contains("Info-ZIP; Zip, UnZip, gzip and zlib co-author; PNG group"); assertThat(text).contains("<i><b>Audio compression</b></i>"); }