diff --git a/http-client-core/src/main/java/io/micronaut/http/client/DefaultHttpClientConfiguration.java b/http-client-core/src/main/java/io/micronaut/http/client/DefaultHttpClientConfiguration.java index 4ddf43f4e8b..3aa14fbf48c 100644 --- a/http-client-core/src/main/java/io/micronaut/http/client/DefaultHttpClientConfiguration.java +++ b/http-client-core/src/main/java/io/micronaut/http/client/DefaultHttpClientConfiguration.java @@ -39,22 +39,39 @@ public class DefaultHttpClientConfiguration extends HttpClientConfiguration { */ public static final String PREFIX = "micronaut.http.client"; private final DefaultConnectionPoolConfiguration connectionPoolConfiguration; + private final DefaultWebSocketCompressionConfiguration webSocketCompressionConfiguration; /** * Default constructor. */ public DefaultHttpClientConfiguration() { this.connectionPoolConfiguration = new DefaultConnectionPoolConfiguration(); + this.webSocketCompressionConfiguration = new DefaultWebSocketCompressionConfiguration(); } /** * @param connectionPoolConfiguration The connection pool configuration * @param applicationConfiguration The application configuration + * @deprecated Use {@link DefaultHttpClientConfiguration(DefaultConnectionPoolConfiguration, DefaultWebSocketCompressionConfiguration, ApplicationConfiguration)} instead. */ - @Inject + @Deprecated(since = "4.3.0") public DefaultHttpClientConfiguration(DefaultConnectionPoolConfiguration connectionPoolConfiguration, ApplicationConfiguration applicationConfiguration) { + this(connectionPoolConfiguration, new DefaultWebSocketCompressionConfiguration(), applicationConfiguration); + } + + + /** + * @param connectionPoolConfiguration The connection pool configuration + * @param webSocketCompressionConfiguration The WebSocket compression configuration + * @param applicationConfiguration The application configuration + */ + @Inject + public DefaultHttpClientConfiguration(DefaultConnectionPoolConfiguration connectionPoolConfiguration, + DefaultWebSocketCompressionConfiguration webSocketCompressionConfiguration, + ApplicationConfiguration applicationConfiguration) { super(applicationConfiguration); this.connectionPoolConfiguration = connectionPoolConfiguration; + this.webSocketCompressionConfiguration = webSocketCompressionConfiguration; } @Override @@ -62,6 +79,11 @@ public ConnectionPoolConfiguration getConnectionPoolConfiguration() { return connectionPoolConfiguration; } + @Override + public WebSocketCompressionConfiguration getWebSocketCompressionConfiguration() { + return webSocketCompressionConfiguration; + } + /** * Uses the default SSL configuration. * @@ -82,4 +104,13 @@ public void setClientSslConfiguration(@Nullable ClientSslConfiguration sslConfig @Primary public static class DefaultConnectionPoolConfiguration extends ConnectionPoolConfiguration { } + + /** + * The default WebSocket compression configuration. + */ + @ConfigurationProperties(WebSocketCompressionConfiguration.PREFIX) + @BootstrapContextCompatible + @Primary + public static class DefaultWebSocketCompressionConfiguration extends WebSocketCompressionConfiguration { + } } diff --git a/http-client-core/src/main/java/io/micronaut/http/client/HttpClientConfiguration.java b/http-client-core/src/main/java/io/micronaut/http/client/HttpClientConfiguration.java index 725bfb2644d..87dc407a52e 100644 --- a/http-client-core/src/main/java/io/micronaut/http/client/HttpClientConfiguration.java +++ b/http-client-core/src/main/java/io/micronaut/http/client/HttpClientConfiguration.java @@ -98,7 +98,6 @@ public abstract class HttpClientConfiguration { /** * The default value. */ - @SuppressWarnings("WeakerAccess") public static final boolean DEFAULT_EXCEPTION_ON_ERROR_STATUS = true; /** @@ -302,6 +301,17 @@ public void setSslConfiguration(SslConfiguration sslConfiguration) { this.sslConfiguration = sslConfiguration; } + /** + * Obtains the WebSocket compression configuration. + * + * @return The WebSocket compression configuration. + * @since 4.3.0 + */ + @Nullable + public WebSocketCompressionConfiguration getWebSocketCompressionConfiguration() { + return null; + } + /** * @return Whether redirects should be followed */ @@ -934,4 +944,42 @@ public void setMaxConcurrentHttp2Connections(int maxConcurrentHttp2Connections) } } + /** + * Configuration for WebSocket client compression extensions. + */ + public static class WebSocketCompressionConfiguration implements Toggleable { + + /** + * The prefix to use for configuration. + */ + public static final String PREFIX = "ws.compression"; + + /** + * The default enable value. + */ + @SuppressWarnings("WeakerAccess") + public static final boolean DEFAULT_ENABLED = true; + + private boolean enabled = DEFAULT_ENABLED; + + /** + * Whether deflate compression is enabled for client WebSocket connections. + * + * @return True if the per message deflate extension is enabled. + */ + @Override + public boolean isEnabled() { + return enabled; + } + + /** + * Sets whether the per message deflate extension is enabled for WebSocket connections. + * Default value ({@link io.micronaut.http.client.HttpClientConfiguration.WebSocketCompressionConfiguration#DEFAULT_ENABLED}). + * + * @param enabled True is it is enabled. + */ + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + } } diff --git a/http-client-core/src/main/java/io/micronaut/http/client/ServiceHttpClientConfiguration.java b/http-client-core/src/main/java/io/micronaut/http/client/ServiceHttpClientConfiguration.java index 41f00e1af6b..cc5aefc3d4d 100644 --- a/http-client-core/src/main/java/io/micronaut/http/client/ServiceHttpClientConfiguration.java +++ b/http-client-core/src/main/java/io/micronaut/http/client/ServiceHttpClientConfiguration.java @@ -68,6 +68,7 @@ public class ServiceHttpClientConfiguration extends HttpClientConfiguration impl private final String serviceId; private final ServiceConnectionPoolConfiguration connectionPoolConfiguration; + private final ServiceWebSocketCompressionConfiguration webSocketCompressionConfiguration; private List urls = Collections.emptyList(); private String healthCheckUri = DEFAULT_HEALTHCHECKURI; private boolean healthCheck = DEFAULT_HEALTHCHECK; @@ -97,6 +98,7 @@ public ServiceHttpClientConfiguration( } else { this.connectionPoolConfiguration = new ServiceConnectionPoolConfiguration(); } + this.webSocketCompressionConfiguration = new ServiceWebSocketCompressionConfiguration(); } /** @@ -106,11 +108,31 @@ public ServiceHttpClientConfiguration( * @param connectionPoolConfiguration The connection pool configuration * @param sslConfiguration The SSL configuration * @param defaultHttpClientConfiguration The default HTTP client configuration + * @deprecated Use {@link ServiceHttpClientConfiguration(String, ServiceConnectionPoolConfiguration, ServiceWebSocketCompressionConfiguration, ServiceSslClientConfiguration, HttpClientConfiguration)} instead. + */ + @Deprecated(since = "4.3.0") + public ServiceHttpClientConfiguration( + @Parameter String serviceId, + @Nullable ServiceConnectionPoolConfiguration connectionPoolConfiguration, + @Nullable ServiceSslClientConfiguration sslConfiguration, + HttpClientConfiguration defaultHttpClientConfiguration) { + this(serviceId, connectionPoolConfiguration, new ServiceWebSocketCompressionConfiguration(), sslConfiguration, defaultHttpClientConfiguration); + } + + /** + * Creates a new client configuration for the given service ID. + * + * @param serviceId The service id + * @param connectionPoolConfiguration The connection pool configuration + * @param webSocketCompressionConfiguration The WebSocket compression configuration + * @param sslConfiguration The SSL configuration + * @param defaultHttpClientConfiguration The default HTTP client configuration */ @Inject public ServiceHttpClientConfiguration( @Parameter String serviceId, @Nullable ServiceConnectionPoolConfiguration connectionPoolConfiguration, + @Nullable ServiceWebSocketCompressionConfiguration webSocketCompressionConfiguration, @Nullable ServiceSslClientConfiguration sslConfiguration, HttpClientConfiguration defaultHttpClientConfiguration) { super(defaultHttpClientConfiguration); @@ -123,6 +145,11 @@ public ServiceHttpClientConfiguration( } else { this.connectionPoolConfiguration = new ServiceConnectionPoolConfiguration(); } + if (webSocketCompressionConfiguration != null) { + this.webSocketCompressionConfiguration = webSocketCompressionConfiguration; + } else { + this.webSocketCompressionConfiguration = new ServiceWebSocketCompressionConfiguration(); + } } /** @@ -248,6 +275,11 @@ public ConnectionPoolConfiguration getConnectionPoolConfiguration() { return connectionPoolConfiguration; } + @Override + public WebSocketCompressionConfiguration getWebSocketCompressionConfiguration() { + return webSocketCompressionConfiguration; + } + /** * The default connection pool configuration. */ @@ -255,6 +287,13 @@ public ConnectionPoolConfiguration getConnectionPoolConfiguration() { public static class ServiceConnectionPoolConfiguration extends ConnectionPoolConfiguration { } + /** + * The default WebSocket compression configuration. + */ + @ConfigurationProperties(WebSocketCompressionConfiguration.PREFIX) + public static class ServiceWebSocketCompressionConfiguration extends WebSocketCompressionConfiguration { + } + /** * The default connection pool configuration. */ diff --git a/http-client/src/main/java/io/micronaut/http/client/netty/ConnectionManager.java b/http-client/src/main/java/io/micronaut/http/client/netty/ConnectionManager.java index 7c52a3a2530..6457d8a43e6 100644 --- a/http-client/src/main/java/io/micronaut/http/client/netty/ConnectionManager.java +++ b/http-client/src/main/java/io/micronaut/http/client/netty/ConnectionManager.java @@ -467,7 +467,9 @@ protected void initChannel(@NonNull Channel ch) { } try { - ch.pipeline().addLast(WebSocketClientCompressionHandler.INSTANCE); + if (configuration.getWebSocketCompressionConfiguration() != null && configuration.getWebSocketCompressionConfiguration().isEnabled()) { + ch.pipeline().addLast(WebSocketClientCompressionHandler.INSTANCE); + } ch.pipeline().addLast(ChannelPipelineCustomizer.HANDLER_MICRONAUT_WEBSOCKET_CLIENT, handler); clientCustomizer.specializeForChannel(ch, NettyClientCustomizer.ChannelRole.CONNECTION).onInitialPipelineBuilt(); if (initial.tryEmitEmpty().isSuccess()) { diff --git a/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java b/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java index 8c0666562ba..2baa54516ac 100644 --- a/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java +++ b/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java @@ -149,7 +149,7 @@ class DefaultNettyHttpClientRegistry implements AutoCloseable, */ public DefaultNettyHttpClientRegistry( HttpClientConfiguration defaultHttpClientConfiguration, - HttpClientFilterResolver httpClientFilterResolver, + HttpClientFilterResolver httpClientFilterResolver, LoadBalancerResolver loadBalancerResolver, ClientSslBuilder nettyClientSslBuilder, ThreadFactory threadFactory, diff --git a/http-client/src/test/groovy/io/micronaut/http/client/ClientSpecificLoggerSpec.groovy b/http-client/src/test/groovy/io/micronaut/http/client/ClientSpecificLoggerSpec.groovy index 088bdb647c5..89d9190c2c3 100644 --- a/http-client/src/test/groovy/io/micronaut/http/client/ClientSpecificLoggerSpec.groovy +++ b/http-client/src/test/groovy/io/micronaut/http/client/ClientSpecificLoggerSpec.groovy @@ -3,6 +3,7 @@ package io.micronaut.http.client import io.micronaut.context.ApplicationContext import io.micronaut.context.annotation.Requires import io.micronaut.core.io.socket.SocketUtils +import io.micronaut.http.client.DefaultHttpClientConfiguration.DefaultWebSocketCompressionConfiguration import io.micronaut.http.client.annotation.Client import io.micronaut.http.client.netty.DefaultHttpClient import io.micronaut.runtime.ApplicationConfiguration @@ -54,10 +55,15 @@ class ClientSpecificLoggerSpec extends Specification { private final DefaultHttpClientConfiguration.DefaultConnectionPoolConfiguration connectionPoolConfiguration + private final DefaultHttpClientConfiguration.DefaultWebSocketCompressionConfiguration webSocketCompressionConfiguration + @Inject - ClientTwoHttpConfiguration(ApplicationConfiguration applicationConfiguration, DefaultHttpClientConfiguration.DefaultConnectionPoolConfiguration connectionPoolConfiguration) { + ClientTwoHttpConfiguration(ApplicationConfiguration applicationConfiguration, + DefaultHttpClientConfiguration.DefaultConnectionPoolConfiguration connectionPoolConfiguration, + DefaultWebSocketCompressionConfiguration webSocketCompressionConfiguration) { super(applicationConfiguration) this.connectionPoolConfiguration = connectionPoolConfiguration + this.webSocketCompressionConfiguration = webSocketCompressionConfiguration } @Override @@ -65,6 +71,11 @@ class ClientSpecificLoggerSpec extends Specification { return this.connectionPoolConfiguration } + @Override + WebSocketCompressionConfiguration getWebSocketCompressionConfiguration() { + return this.webSocketCompressionConfiguration + } + @Override Optional getLoggerName() { return Optional.of("${ClientSpecificLoggerSpec.class}.client.two".toString()) diff --git a/http-client/src/test/groovy/io/micronaut/http/client/config/DefaultHttpClientConfigurationSpec.groovy b/http-client/src/test/groovy/io/micronaut/http/client/config/DefaultHttpClientConfigurationSpec.groovy index c991572766e..8c6d6cdd701 100644 --- a/http-client/src/test/groovy/io/micronaut/http/client/config/DefaultHttpClientConfigurationSpec.groovy +++ b/http-client/src/test/groovy/io/micronaut/http/client/config/DefaultHttpClientConfigurationSpec.groovy @@ -1,18 +1,3 @@ -/* - * Copyright 2017-2019 original authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package io.micronaut.http.client.config import io.micronaut.context.ApplicationContext @@ -20,15 +5,11 @@ import io.micronaut.http.client.DefaultHttpClientConfiguration import io.micronaut.http.client.HttpClientConfiguration import spock.lang.Issue import spock.lang.Specification -import spock.lang.Unroll import java.time.Duration -//required because https://issues.apache.org/jira/browse/GROOVY-9566 - class DefaultHttpClientConfigurationSpec extends Specification { - @Unroll void "test config for #key"() { given: def ctx = ApplicationContext.run( @@ -36,7 +17,6 @@ class DefaultHttpClientConfigurationSpec extends Specification { ) HttpClientConfiguration config = ctx.getBean(HttpClientConfiguration) - expect: config[property] == expected @@ -56,41 +36,50 @@ class DefaultHttpClientConfigurationSpec extends Specification { 'shutdown-quiet-period' | 'shutdownQuietPeriod' | '2s' | Optional.of(Duration.ofSeconds(2)) 'shutdown-timeout' | 'shutdownTimeout' | '100ms' | Optional.of(Duration.ofMillis(100)) 'shutdown-timeout' | 'shutdownTimeout' | '15s' | Optional.of(Duration.ofSeconds(15)) + 'follow-redirects' | 'followRedirects' | 'false' | false } - void "test pool config"() { given: def ctx = ApplicationContext.run( - ("micronaut.http.client.pool.$key".toString()): value + 'micronaut.http.client.pool.enabled': false ) HttpClientConfiguration config = ctx.getBean(HttpClientConfiguration) - HttpClientConfiguration.ConnectionPoolConfiguration poolConfig = config.getConnectionPoolConfiguration() expect: - poolConfig[property] == expected + !config.connectionPoolConfiguration.enabled cleanup: ctx.close() + } - where: - key | property | value | expected - 'enabled' | 'enabled' | 'false' | false + void "test WebSocket compression config"() { + given: + def ctx = ApplicationContext.run( + 'micronaut.http.client.ws.compression.enabled': false + ) + HttpClientConfiguration config = ctx.getBean(HttpClientConfiguration) + HttpClientConfiguration.WebSocketCompressionConfiguration compressionConfig = config.getWebSocketCompressionConfiguration() + + expect: + !config.webSocketCompressionConfiguration.enabled + + cleanup: + ctx.close() } void "test overriding logger for the client"() { given: def ctx = ApplicationContext.run( - ("micronaut.http.client.loggerName".toString()): "myclient.custom.logger" + 'micronaut.http.client.loggerName': 'myclient.custom.logger' ) HttpClientConfiguration config = ctx.getBean(HttpClientConfiguration) expect: - config['loggerName'] == Optional.of('myclient.custom.logger') + config.loggerName == Optional.of('myclient.custom.logger') cleanup: ctx.close() - } void "test setting a proxy selector" () { @@ -99,13 +88,10 @@ class DefaultHttpClientConfigurationSpec extends Specification { when: "I register proxy selector that use proxy for addressOne but not for addressTwo" config.setProxySelector(new ProxySelector() { + @Override List select(URI uri) { - if (uri.host == "a") { - return [ new Proxy(Proxy.Type.HTTP, new InetSocketAddress(8080)) ] - } else { - return [ Proxy.NO_PROXY ] - } + uri.host == 'a' ? [ new Proxy(Proxy.Type.HTTP, new InetSocketAddress(8080)) ] : [ Proxy.NO_PROXY ] } @Override @@ -116,6 +102,7 @@ class DefaultHttpClientConfigurationSpec extends Specification { then: "proxy is used for first address but not for the second" def proxyOne = config.resolveProxy(false, "a", 80) + proxyOne.type() == Proxy.Type.HTTP proxyOne.address().port == 8080 @@ -126,7 +113,8 @@ class DefaultHttpClientConfigurationSpec extends Specification { void "default connection pool idle timeout"() { given: def cfg = new DefaultHttpClientConfiguration() + expect: - cfg.connectionPoolIdleTimeout.isEmpty() + cfg.connectionPoolIdleTimeout.empty } } diff --git a/http-netty/src/main/java/io/micronaut/http/netty/body/NettyJsonHandler.java b/http-netty/src/main/java/io/micronaut/http/netty/body/NettyJsonHandler.java index 5c546191818..b780a8e72c1 100644 --- a/http-netty/src/main/java/io/micronaut/http/netty/body/NettyJsonHandler.java +++ b/http-netty/src/main/java/io/micronaut/http/netty/body/NettyJsonHandler.java @@ -150,7 +150,7 @@ public ByteBuffer writeTo(Argument type, MediaType mediaType, T object, Mu } @Override - public @NonNull void writeTo(@NonNull HttpRequest request, @NonNull MutableHttpResponse outgoingResponse, @NonNull Argument type, @NonNull MediaType mediaType, @NonNull T object, @NonNull NettyWriteContext nettyContext) throws CodecException { + public void writeTo(@NonNull HttpRequest request, @NonNull MutableHttpResponse outgoingResponse, @NonNull Argument type, @NonNull MediaType mediaType, @NonNull T object, @NonNull NettyWriteContext nettyContext) throws CodecException { NettyHttpHeaders nettyHttpHeaders = (NettyHttpHeaders) outgoingResponse.getHeaders(); if (!nettyHttpHeaders.contains(HttpHeaders.CONTENT_TYPE)) { nettyHttpHeaders.set(HttpHeaderNames.CONTENT_TYPE, mediaType); diff --git a/http-server-netty/src/test/groovy/io/micronaut/http/server/netty/websocket/BinaryWebSocketSpec.groovy b/http-server-netty/src/test/groovy/io/micronaut/http/server/netty/websocket/BinaryWebSocketSpec.groovy index 66c59ced00c..d83c9c5be04 100644 --- a/http-server-netty/src/test/groovy/io/micronaut/http/server/netty/websocket/BinaryWebSocketSpec.groovy +++ b/http-server-netty/src/test/groovy/io/micronaut/http/server/netty/websocket/BinaryWebSocketSpec.groovy @@ -250,7 +250,7 @@ class BinaryWebSocketSpec extends Specification { fred.sendMany() - then: + then: "Messages were compressed" conditions.eventually { bob.replies.contains("[fred] abcdef") } @@ -263,6 +263,64 @@ class BinaryWebSocketSpec extends Specification { embeddedServer.close() } + @Issue('https://github.com/micronaut-projects/micronaut-core/issues/7711') + void "test per-message compression disabled"() { + given: + def ctx = ApplicationContext.run([ + 'spec.name' : 'test per-message compression', + 'micronaut.server.port': -1, + 'micronaut.http.client.ws.compression.enabled': false + ]) + def cdcServer = ctx.getBean(CompressionDetectionCustomizerServer) + def cdcClient = ctx.getBean(CompressionDetectionCustomizerClient) + EmbeddedServer embeddedServer = ctx.getBean(EmbeddedServer) + embeddedServer.start() + PollingConditions conditions = new PollingConditions(timeout: 15, delay: 0.5) + + when: "a websocket connection is established" + WebSocketClient wsClient = embeddedServer.applicationContext.createBean(WebSocketClient, embeddedServer.getURI()) + BinaryChatClientWebSocket fred = wsClient.connect(BinaryChatClientWebSocket, "/binary/chat/stuff/fred").blockFirst() + BinaryChatClientWebSocket bob = wsClient.connect(BinaryChatClientWebSocket, [topic: "stuff", username: "bob"]).blockFirst() + + + then: "The connection is valid" + fred.session != null + fred.session.id != null + conditions.eventually { + fred.replies.contains("[bob] Joined!") + fred.replies.size() == 1 + } + + cdcServer.getPipelines().size() == 2 + cdcClient.getPipelines().size() == 2 + + when: "A message is sent" + List interceptors = new ArrayList<>() + for (ChannelPipeline pipeline : cdcServer.getPipelines() + cdcClient.getPipelines()) { + def interceptor = new MessageInterceptor() + if (pipeline.get('ws-encoder') != null) { + pipeline.addAfter('ws-encoder', 'MessageInterceptor', interceptor) + } else { + pipeline.addAfter('wsencoder', 'MessageInterceptor', interceptor) + } + interceptors.add(interceptor) + } + + fred.sendMany() + + then: "Messages were not compressed" + conditions.eventually { + bob.replies.contains("[fred] abcdef") + } + interceptors.every { !it.seenCompressedMessage } + + cleanup: + fred.close() + bob.close() + wsClient.close() + embeddedServer.close() + } + @Singleton @Requires(property = 'spec.name', value = 'test per-message compression') static class CompressionDetectionCustomizerServer implements BeanCreatedEventListener { diff --git a/management/src/test/groovy/io/micronaut/management/health/indicator/client/ServiceHttpClientHealthIndicatorSpec.groovy b/management/src/test/groovy/io/micronaut/management/health/indicator/client/ServiceHttpClientHealthIndicatorSpec.groovy index 24b88ea1073..ab6ff8b9739 100644 --- a/management/src/test/groovy/io/micronaut/management/health/indicator/client/ServiceHttpClientHealthIndicatorSpec.groovy +++ b/management/src/test/groovy/io/micronaut/management/health/indicator/client/ServiceHttpClientHealthIndicatorSpec.groovy @@ -1,9 +1,10 @@ package io.micronaut.management.health.indicator.client + import io.micronaut.discovery.StaticServiceInstanceList import io.micronaut.health.HealthStatus +import io.micronaut.http.client.HttpClientConfiguration import io.micronaut.http.client.ServiceHttpClientConfiguration -import io.micronaut.runtime.ApplicationConfiguration import reactor.core.publisher.Mono import spock.lang.Specification @@ -13,7 +14,10 @@ class ServiceHttpClientHealthIndicatorSpec extends Specification { def static uri2 = new URI("http://localhost:8081") def instanceList = new StaticServiceInstanceList("some-http-service", [uri1, uri2]) - def serviceHttpConfiguration = new ServiceHttpClientConfiguration("some-http-service", null, null, GroovyMock(ApplicationConfiguration)) + ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration connectionPoolConfiguration = null + ServiceHttpClientConfiguration.ServiceWebSocketCompressionConfiguration webSocketCompressionConfiguration = null + ServiceHttpClientConfiguration.ServiceSslClientConfiguration sslConfiguration = null + ServiceHttpClientConfiguration serviceHttpConfiguration = new ServiceHttpClientConfiguration("some-http-service", connectionPoolConfiguration, webSocketCompressionConfiguration, sslConfiguration, Mock(HttpClientConfiguration)) def "Health Indicator is set to true and is healthy"() { given: