BrotliServletFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { try { BrotliLibraryLoader.loadBrotli(); } catch (UnsatisfiedLinkError | IllegalStateException | SecurityException e) { throw new ServletException(e); } applyFilterConfig(filterConfig); }  @Override void init(FilterConfig filterConfig); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); static final String BROTLI_HTTP_CONTENT_CODING; static final String BROTLI_COMPRESSION_PARAMETER_MODE; static final String BROTLI_COMPRESSION_PARAMETER_QUALITY; static final String BROTLI_COMPRESSION_PARAMETER_LGWIN; static final String BROTLI_COMPRESSION_PARAMETER_LGBLOCK; }
@Test public void testName() throws Exception { Map<String, String> filterConfig = new HashMap<>(); filterConfig.put("brotli.compression.parameter.mode", "font"); filterConfig.put("brotli.compression.parameter.quality", "11"); filterConfig.put("brotli.compression.parameter.lgwin", "5"); filterConfig.put("brotli.compression.parameter.lgblock", "7"); servletFilter.init(new MockFilterConfig(filterConfig)); assertThat(servletFilter.brotliCompressionParameter.getMode()).isEqualTo(Brotli.Mode.FONT); assertThat(servletFilter.brotliCompressionParameter.getQuality()).isEqualTo(11); assertThat(servletFilter.brotliCompressionParameter.getLgwin()).isEqualTo(5); assertThat(servletFilter.brotliCompressionParameter.getLgblock()).isEqualTo(7); }