From 38202d7538a9ada7b1b2a2be0e952da6733884ff Mon Sep 17 00:00:00 2001 From: Kiran Godishala <53332225+kirangodishala@users.noreply.github.com> Date: Thu, 7 Nov 2024 22:44:17 +0530 Subject: [PATCH] refactor(retrofit): replace com.squareup.okhttp.OkHttpClient with okhttp3.OkHttpClient (#1063) --- .../atlas/backends/AtlasStorageUpdater.java | 2 +- .../backends/AtlasStorageUpdaterService.java | 2 +- .../atlas/backends/BackendUpdater.java | 2 +- .../atlas/backends/BackendUpdaterService.java | 2 +- .../atlas/metrics/AtlasMetricsService.java | 10 +++--- .../config/RetrofitClientConfiguration.java | 22 +++--------- .../config/RetrofitClientFactory.java | 35 +++++-------------- .../datadog/config/DatadogConfiguration.java | 2 +- ...sDoNotLeakWhenApiCalledFunctionalTest.java | 2 +- .../config/GraphiteConfiguration.java | 2 +- .../config/InfluxDbConfiguration.java | 2 +- .../netflix/kayenta/judge/RemoteJudge.java | 10 +++--- .../config/NewRelicConfiguration.java | 2 +- .../config/ConfigBinConfiguration.java | 2 +- .../config/PrometheusConfiguration.java | 2 +- .../service/PrometheusRemoteServiceTest.java | 2 +- .../config/SignalFxConfiguration.java | 2 +- .../config/SignalFxConfigLoadTest.java | 2 +- .../config/WavefrontConfiguration.java | 2 +- 19 files changed, 39 insertions(+), 68 deletions(-) diff --git a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdater.java b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdater.java index 56bfb558b..9fef2e0ae 100644 --- a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdater.java +++ b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdater.java @@ -23,12 +23,12 @@ import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException; import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerServerException; import com.netflix.spinnaker.security.AuthenticatedRequest; -import com.squareup.okhttp.OkHttpClient; import java.util.Map; import javax.validation.constraints.NotNull; import lombok.Builder; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import retrofit.converter.JacksonConverter; @Slf4j diff --git a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdaterService.java b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdaterService.java index b653cad66..c92d2cad5 100644 --- a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdaterService.java +++ b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/AtlasStorageUpdaterService.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; -import com.squareup.okhttp.OkHttpClient; import java.util.ArrayList; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.health.AbstractHealthIndicator; import org.springframework.boot.actuate.health.Health; diff --git a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdater.java b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdater.java index 0ce2bf9dd..2f76ae941 100644 --- a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdater.java +++ b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdater.java @@ -23,12 +23,12 @@ import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException; import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerServerException; import com.netflix.spinnaker.security.AuthenticatedRequest; -import com.squareup.okhttp.OkHttpClient; import java.util.List; import javax.validation.constraints.NotNull; import lombok.Builder; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import retrofit.converter.JacksonConverter; @Slf4j diff --git a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdaterService.java b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdaterService.java index b20e9dc50..1d39d94b1 100644 --- a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdaterService.java +++ b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/backends/BackendUpdaterService.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; -import com.squareup.okhttp.OkHttpClient; import java.util.ArrayList; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.health.AbstractHealthIndicator; import org.springframework.boot.actuate.health.Health; diff --git a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/metrics/AtlasMetricsService.java b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/metrics/AtlasMetricsService.java index 2e3a0c2db..713b594de 100644 --- a/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/metrics/AtlasMetricsService.java +++ b/kayenta-atlas/src/main/java/com/netflix/kayenta/atlas/metrics/AtlasMetricsService.java @@ -39,7 +39,6 @@ import com.netflix.kayenta.security.AccountCredentialsRepository; import com.netflix.kayenta.util.Retry; import com.netflix.spectator.api.Registry; -import com.squareup.okhttp.OkHttpClient; import java.time.Duration; import java.time.Instant; import java.util.*; @@ -50,6 +49,7 @@ import lombok.Getter; import lombok.Singular; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.beans.factory.annotation.Autowired; @Builder @@ -94,9 +94,11 @@ public List queryMetrics( CanaryMetricConfig canaryMetricConfig, CanaryScope canaryScope) { - OkHttpClient okHttpClient = new OkHttpClient(); - okHttpClient.setConnectTimeout(30, TimeUnit.SECONDS); - okHttpClient.setReadTimeout(90, TimeUnit.SECONDS); + OkHttpClient okHttpClient = + new OkHttpClient.Builder() + .connectTimeout(30, TimeUnit.SECONDS) + .readTimeout(90, TimeUnit.SECONDS) + .build(); if (!(canaryScope instanceof AtlasCanaryScope)) { throw new IllegalArgumentException( diff --git a/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java b/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java index 3037cc929..ea2ecbd40 100644 --- a/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java +++ b/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java @@ -19,11 +19,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.netflix.kayenta.atlas.config.KayentaSerializationConfigurationProperties; import com.netflix.kayenta.config.KayentaConfiguration; -import com.netflix.spinnaker.config.OkHttpClientConfiguration; +import com.netflix.spinnaker.config.OkHttp3ClientConfiguration; import com.netflix.spinnaker.orca.retrofit.exceptions.SpinnakerServerExceptionHandler; -import com.squareup.okhttp.ConnectionPool; -import com.squareup.okhttp.OkHttpClient; -import org.springframework.beans.factory.annotation.Value; +import okhttp3.OkHttpClient; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.*; @@ -33,22 +31,10 @@ @Configuration public class RetrofitClientConfiguration { - @Value("${ok-http-client.connection-pool.max-idle-connections:5}") - int maxIdleConnections; - - @Value("${ok-http-client.connection-pool.keep-alive-duration-ms:300000}") - int keepAliveDurationMs; - - @Value("${ok-http-client.retry-on-connection-failure:true}") - boolean retryOnConnectionFailure; - @Bean @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) - OkHttpClient okHttpClient(OkHttpClientConfiguration okHttpClientConfig) { - OkHttpClient okHttpClient = okHttpClientConfig.create(); - okHttpClient.setConnectionPool(new ConnectionPool(maxIdleConnections, keepAliveDurationMs)); - okHttpClient.setRetryOnConnectionFailure(retryOnConnectionFailure); - return okHttpClient; + OkHttpClient okHttpClient(OkHttp3ClientConfiguration okHttp3ClientConfig) { + return okHttp3ClientConfig.create().build(); } @Bean diff --git a/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientFactory.java b/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientFactory.java index 1067fecd4..4380fb40e 100644 --- a/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientFactory.java +++ b/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientFactory.java @@ -19,19 +19,16 @@ import static retrofit.Endpoints.newFixedEndpoint; import com.fasterxml.jackson.databind.ObjectMapper; +import com.jakewharton.retrofit.Ok3Client; import com.netflix.spinnaker.kork.annotations.VisibleForTesting; import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerRetrofitErrorHandler; import com.netflix.spinnaker.retrofit.Slf4jRetrofitLogger; -import com.squareup.okhttp.Authenticator; import com.squareup.okhttp.Credentials; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; import java.io.IOException; -import java.net.Proxy; import java.nio.file.Files; import java.nio.file.Paths; import java.util.function.Function; +import okhttp3.OkHttpClient; import org.apache.commons.lang3.StringUtils; import org.apache.tomcat.util.codec.binary.Base64; import org.springframework.beans.factory.annotation.Value; @@ -39,7 +36,6 @@ import org.springframework.stereotype.Component; import retrofit.Endpoint; import retrofit.RestAdapter; -import retrofit.client.OkClient; import retrofit.converter.Converter; import retrofit.converter.JacksonConverter; @@ -118,7 +114,7 @@ public T createClient( return new RestAdapter.Builder() .setEndpoint(endpoint) - .setClient(new OkClient(okHttpClient)) + .setClient(new Ok3Client(okHttpClient)) .setConverter(converter) .setErrorHandler(SpinnakerRetrofitErrorHandler.getInstance()) .setLogLevel(RestAdapter.LogLevel.valueOf(retrofitLogLevel)) @@ -143,25 +139,10 @@ private static OkHttpClient createAuthenticatedClient( credential = Credentials.basic(username, password); } - OkHttpClient httpClient = new OkHttpClient(); - - httpClient.setAuthenticator( - new Authenticator() { - @Override - public Request authenticate(Proxy proxy, Response response) throws IOException { - return response.request().newBuilder().header("Authorization", credential).build(); - } - - @Override - public Request authenticateProxy(Proxy proxy, Response response) throws IOException { - return response - .request() - .newBuilder() - .header("Proxy-Authorization", credential) - .build(); - } - }); - - return httpClient; + return new OkHttpClient.Builder() + .authenticator( + (route, response) -> + response.request().newBuilder().header("Authorization", credential).build()) + .build(); } } diff --git a/kayenta-datadog/src/main/java/com/netflix/kayenta/datadog/config/DatadogConfiguration.java b/kayenta-datadog/src/main/java/com/netflix/kayenta/datadog/config/DatadogConfiguration.java index ec58253a8..d42c37733 100644 --- a/kayenta-datadog/src/main/java/com/netflix/kayenta/datadog/config/DatadogConfiguration.java +++ b/kayenta-datadog/src/main/java/com/netflix/kayenta/datadog/config/DatadogConfiguration.java @@ -27,10 +27,10 @@ import com.netflix.kayenta.security.AccountCredentials; import com.netflix.kayenta.security.AccountCredentialsRepository; import com.netflix.spinnaker.kork.annotations.VisibleForTesting; -import com.squareup.okhttp.OkHttpClient; import java.io.IOException; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/kayenta-datadog/src/test/java/com/netflix/kayenta/datadog/functional/DatadogSecretsDoNotLeakWhenApiCalledFunctionalTest.java b/kayenta-datadog/src/test/java/com/netflix/kayenta/datadog/functional/DatadogSecretsDoNotLeakWhenApiCalledFunctionalTest.java index 629f87f30..2f7fdbb62 100644 --- a/kayenta-datadog/src/test/java/com/netflix/kayenta/datadog/functional/DatadogSecretsDoNotLeakWhenApiCalledFunctionalTest.java +++ b/kayenta-datadog/src/test/java/com/netflix/kayenta/datadog/functional/DatadogSecretsDoNotLeakWhenApiCalledFunctionalTest.java @@ -33,11 +33,11 @@ import com.netflix.kayenta.retrofit.config.RemoteService; import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; import com.netflix.spinnaker.retrofit.Slf4jRetrofitLogger; -import com.squareup.okhttp.OkHttpClient; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.List; import java.util.stream.Collectors; +import okhttp3.OkHttpClient; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kayenta-graphite/src/main/java/com/netflix/kayenta/graphite/config/GraphiteConfiguration.java b/kayenta-graphite/src/main/java/com/netflix/kayenta/graphite/config/GraphiteConfiguration.java index 5fbace763..6b883dd2e 100644 --- a/kayenta-graphite/src/main/java/com/netflix/kayenta/graphite/config/GraphiteConfiguration.java +++ b/kayenta-graphite/src/main/java/com/netflix/kayenta/graphite/config/GraphiteConfiguration.java @@ -25,10 +25,10 @@ import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; import com.netflix.kayenta.security.AccountCredentials; import com.netflix.kayenta.security.AccountCredentialsRepository; -import com.squareup.okhttp.OkHttpClient; import java.io.IOException; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/kayenta-influxdb/src/main/java/com/netflix/kayenta/influxdb/config/InfluxDbConfiguration.java b/kayenta-influxdb/src/main/java/com/netflix/kayenta/influxdb/config/InfluxDbConfiguration.java index df2c38fd0..015441904 100644 --- a/kayenta-influxdb/src/main/java/com/netflix/kayenta/influxdb/config/InfluxDbConfiguration.java +++ b/kayenta-influxdb/src/main/java/com/netflix/kayenta/influxdb/config/InfluxDbConfiguration.java @@ -25,10 +25,10 @@ import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; import com.netflix.kayenta.security.AccountCredentials; import com.netflix.kayenta.security.AccountCredentialsRepository; -import com.squareup.okhttp.OkHttpClient; import java.io.IOException; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/kayenta-judge/src/main/scala/com/netflix/kayenta/judge/RemoteJudge.java b/kayenta-judge/src/main/scala/com/netflix/kayenta/judge/RemoteJudge.java index b6f6b81d0..52ed818a8 100644 --- a/kayenta-judge/src/main/scala/com/netflix/kayenta/judge/RemoteJudge.java +++ b/kayenta-judge/src/main/scala/com/netflix/kayenta/judge/RemoteJudge.java @@ -27,10 +27,10 @@ import com.netflix.kayenta.metrics.MetricSetPair; import com.netflix.kayenta.retrofit.config.RemoteService; import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; -import com.squareup.okhttp.OkHttpClient; import java.util.List; import java.util.concurrent.TimeUnit; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import retrofit.converter.JacksonConverter; @@ -73,9 +73,11 @@ public CanaryJudgeResult judge( CanaryClassifierThresholdsConfig scoreThresholds, List metricSetPairList) { - OkHttpClient okHttpClient = new OkHttpClient(); - okHttpClient.setConnectTimeout(30, TimeUnit.SECONDS); - okHttpClient.setReadTimeout(90, TimeUnit.SECONDS); + OkHttpClient okHttpClient = + new OkHttpClient.Builder() + .connectTimeout(30, TimeUnit.SECONDS) + .readTimeout(90, TimeUnit.SECONDS) + .build(); RemoteJudgeService remoteJudge = retrofitClientFactory.createClient( diff --git a/kayenta-newrelic-insights/src/main/java/com/netflix/kayenta/newrelic/config/NewRelicConfiguration.java b/kayenta-newrelic-insights/src/main/java/com/netflix/kayenta/newrelic/config/NewRelicConfiguration.java index 14df487b5..6b8d835af 100644 --- a/kayenta-newrelic-insights/src/main/java/com/netflix/kayenta/newrelic/config/NewRelicConfiguration.java +++ b/kayenta-newrelic-insights/src/main/java/com/netflix/kayenta/newrelic/config/NewRelicConfiguration.java @@ -26,11 +26,11 @@ import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; import com.netflix.kayenta.security.AccountCredentials; import com.netflix.kayenta.security.AccountCredentialsRepository; -import com.squareup.okhttp.OkHttpClient; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinConfiguration.java b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinConfiguration.java index 44210413b..f7099110a 100644 --- a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinConfiguration.java +++ b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinConfiguration.java @@ -24,9 +24,9 @@ import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; import com.netflix.kayenta.security.AccountCredentials; import com.netflix.kayenta.security.AccountCredentialsRepository; -import com.squareup.okhttp.OkHttpClient; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/kayenta-prometheus/src/main/java/com/netflix/kayenta/prometheus/config/PrometheusConfiguration.java b/kayenta-prometheus/src/main/java/com/netflix/kayenta/prometheus/config/PrometheusConfiguration.java index 4a4dc220b..17acbdf0c 100644 --- a/kayenta-prometheus/src/main/java/com/netflix/kayenta/prometheus/config/PrometheusConfiguration.java +++ b/kayenta-prometheus/src/main/java/com/netflix/kayenta/prometheus/config/PrometheusConfiguration.java @@ -26,10 +26,10 @@ import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; import com.netflix.kayenta.security.AccountCredentials; import com.netflix.kayenta.security.AccountCredentialsRepository; -import com.squareup.okhttp.OkHttpClient; import java.io.IOException; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/kayenta-prometheus/src/test/java/com/netflix/kayenta/prometheus/service/PrometheusRemoteServiceTest.java b/kayenta-prometheus/src/test/java/com/netflix/kayenta/prometheus/service/PrometheusRemoteServiceTest.java index c633be76e..d74d71a70 100644 --- a/kayenta-prometheus/src/test/java/com/netflix/kayenta/prometheus/service/PrometheusRemoteServiceTest.java +++ b/kayenta-prometheus/src/test/java/com/netflix/kayenta/prometheus/service/PrometheusRemoteServiceTest.java @@ -28,7 +28,6 @@ import com.netflix.kayenta.retrofit.config.RemoteService; import com.netflix.kayenta.retrofit.config.RetrofitClientFactory; import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerServerException; -import com.squareup.okhttp.OkHttpClient; import java.io.File; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -36,6 +35,7 @@ import java.util.List; import java.util.Scanner; import lombok.SneakyThrows; +import okhttp3.OkHttpClient; import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/kayenta-signalfx/src/main/java/com/netflix/kayenta/signalfx/config/SignalFxConfiguration.java b/kayenta-signalfx/src/main/java/com/netflix/kayenta/signalfx/config/SignalFxConfiguration.java index 7142986ca..2ca3aea7a 100644 --- a/kayenta-signalfx/src/main/java/com/netflix/kayenta/signalfx/config/SignalFxConfiguration.java +++ b/kayenta-signalfx/src/main/java/com/netflix/kayenta/signalfx/config/SignalFxConfiguration.java @@ -27,12 +27,12 @@ import com.netflix.kayenta.signalfx.security.SignalFxNamedAccountCredentials; import com.netflix.kayenta.signalfx.service.SignalFxConverter; import com.netflix.kayenta.signalfx.service.SignalFxSignalFlowRemoteService; -import com.squareup.okhttp.OkHttpClient; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/kayenta-signalfx/src/test/java/com/netflix/kayenta/signalfx/config/SignalFxConfigLoadTest.java b/kayenta-signalfx/src/test/java/com/netflix/kayenta/signalfx/config/SignalFxConfigLoadTest.java index 41c038dc6..8d4a49959 100644 --- a/kayenta-signalfx/src/test/java/com/netflix/kayenta/signalfx/config/SignalFxConfigLoadTest.java +++ b/kayenta-signalfx/src/test/java/com/netflix/kayenta/signalfx/config/SignalFxConfigLoadTest.java @@ -24,8 +24,8 @@ import com.netflix.kayenta.security.AccountCredentials; import com.netflix.kayenta.security.AccountCredentialsRepository; import com.netflix.kayenta.security.MapBackedAccountCredentialsRepository; -import com.squareup.okhttp.OkHttpClient; import java.util.List; +import okhttp3.OkHttpClient; import org.junit.jupiter.api.Test; public class SignalFxConfigLoadTest { diff --git a/kayenta-wavefront/src/main/java/com/netflix/kayenta/wavefront/config/WavefrontConfiguration.java b/kayenta-wavefront/src/main/java/com/netflix/kayenta/wavefront/config/WavefrontConfiguration.java index 673413ac7..a1f222b06 100644 --- a/kayenta-wavefront/src/main/java/com/netflix/kayenta/wavefront/config/WavefrontConfiguration.java +++ b/kayenta-wavefront/src/main/java/com/netflix/kayenta/wavefront/config/WavefrontConfiguration.java @@ -24,10 +24,10 @@ import com.netflix.kayenta.wavefront.security.WavefrontCredentials; import com.netflix.kayenta.wavefront.security.WavefrontNamedAccountCredentials; import com.netflix.kayenta.wavefront.service.WavefrontRemoteService; -import com.squareup.okhttp.OkHttpClient; import java.io.IOException; import java.util.List; import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean;