From 200eb962d4e8d837f00b5dd64cb1b372157757fe Mon Sep 17 00:00:00 2001 From: Kiran Godishala <53332225+kirangodishala@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:58:51 +0530 Subject: [PATCH] refactor(retrofit): remove all com.squareup.okhttp dependencies (#1064) --- build.gradle | 3 --- kayenta-atlas/kayenta-atlas.gradle | 4 ---- .../kayenta/retrofit/config/RetrofitClientFactory.java | 2 +- .../kayenta/configbin/config/ConfigBinResponseConverter.java | 2 +- .../kayenta/configbin/service/ConfigBinRemoteService.java | 2 +- .../kayenta/configbin/storage/ConfigBinStorageService.java | 4 ++-- 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index f275981ae..dfa601883 100644 --- a/build.gradle +++ b/build.gradle @@ -96,9 +96,6 @@ subprojects { project -> api "com.squareup.retrofit:retrofit" api "com.squareup.retrofit:converter-jackson" - api "com.squareup.okhttp:okhttp" - api "com.squareup.okhttp:okhttp-urlconnection" - api "com.squareup.okhttp:okhttp-apache" testImplementation "org.springframework.boot:spring-boot-starter-test" testImplementation "org.spockframework:spock-core" diff --git a/kayenta-atlas/kayenta-atlas.gradle b/kayenta-atlas/kayenta-atlas.gradle index 0b018e772..e62990d47 100644 --- a/kayenta-atlas/kayenta-atlas.gradle +++ b/kayenta-atlas/kayenta-atlas.gradle @@ -3,10 +3,6 @@ dependencies { api "com.squareup.retrofit:retrofit" api "com.squareup.retrofit:converter-jackson" - api "com.squareup.okhttp:okhttp" - api "com.squareup.okhttp:okhttp-urlconnection" - api "com.squareup.okhttp:okhttp-apache" - api "org.apache.commons:commons-io:1.3.2" implementation "io.spinnaker.kork:kork-retrofit" 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 4380fb40e..d7dcee2bb 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 @@ -23,11 +23,11 @@ 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.Credentials; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.function.Function; +import okhttp3.Credentials; import okhttp3.OkHttpClient; import org.apache.commons.lang3.StringUtils; import org.apache.tomcat.util.codec.binary.Base64; diff --git a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinResponseConverter.java b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinResponseConverter.java index aaa60a56f..bf90f4c1e 100644 --- a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinResponseConverter.java +++ b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/config/ConfigBinResponseConverter.java @@ -16,7 +16,6 @@ package com.netflix.kayenta.configbin.config; -import com.squareup.okhttp.RequestBody; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -24,6 +23,7 @@ import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import lombok.extern.slf4j.Slf4j; +import okhttp3.RequestBody; import okio.Buffer; import org.springframework.stereotype.Component; import retrofit.converter.ConversionException; diff --git a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/service/ConfigBinRemoteService.java b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/service/ConfigBinRemoteService.java index b3a576719..4a39d1f82 100644 --- a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/service/ConfigBinRemoteService.java +++ b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/service/ConfigBinRemoteService.java @@ -16,7 +16,7 @@ package com.netflix.kayenta.configbin.service; -import com.squareup.okhttp.RequestBody; +import okhttp3.RequestBody; import retrofit.client.Response; import retrofit.http.*; diff --git a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/storage/ConfigBinStorageService.java b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/storage/ConfigBinStorageService.java index db1606863..428e6044c 100644 --- a/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/storage/ConfigBinStorageService.java +++ b/kayenta-objectstore-configbin/src/main/java/com/netflix/kayenta/configbin/storage/ConfigBinStorageService.java @@ -33,8 +33,6 @@ import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerServerException; import com.netflix.spinnaker.kork.web.exceptions.NotFoundException; import com.netflix.spinnaker.security.AuthenticatedRequest; -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.RequestBody; import java.io.IOException; import java.time.Instant; import java.util.*; @@ -44,6 +42,8 @@ import lombok.Getter; import lombok.Singular; import lombok.extern.slf4j.Slf4j; +import okhttp3.MediaType; +import okhttp3.RequestBody; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils;