@Test public void shouldEnableCompression() { given(mockFactory.getCompression()).willReturn(mockCompression); given(mockCompression.getEnabled()).willReturn(true); CompressionCustomizer customizer = new CompressionCustomizer(mockFactory); customizer.apply(mockHttpServerOptions); verify(mockHttpServerOptions).setCompressionSupported(true); }
@Override public HttpServerOptions apply(HttpServerOptions options) { Compression compression = factory.getCompression(); if (compression != null) { options.setCompressionSupported(compression.getEnabled()); } return options; }
CompressionCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { Compression compression = factory.getCompression(); if (compression != null) { options.setCompressionSupported(compression.getEnabled()); } return options; } }
CompressionCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { Compression compression = factory.getCompression(); if (compression != null) { options.setCompressionSupported(compression.getEnabled()); } return options; } CompressionCustomizer(AbstractConfigurableWebServerFactory factory); }
CompressionCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { Compression compression = factory.getCompression(); if (compression != null) { options.setCompressionSupported(compression.getEnabled()); } return options; } CompressionCustomizer(AbstractConfigurableWebServerFactory factory); @Override HttpServerOptions apply(HttpServerOptions options); }
CompressionCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { Compression compression = factory.getCompression(); if (compression != null) { options.setCompressionSupported(compression.getEnabled()); } return options; } CompressionCustomizer(AbstractConfigurableWebServerFactory factory); @Override HttpServerOptions apply(HttpServerOptions options);  }