From 318567491cd7b73c76c132ee31c700347b8cbb8b Mon Sep 17 00:00:00 2001 From: abehrens <61003964+abehrens13@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:48:50 +0100 Subject: [PATCH 1/2] fix deprecated import --- .../Java/libraries/resttemplate/auth/HttpBasicAuth.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache index 5f535b3698a..c698e68abf5 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache @@ -4,7 +4,7 @@ import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; +import java.util.Base64; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} From c8bdc48dccf80f86f3dfb73697476047809a04d1 Mon Sep 17 00:00:00 2001 From: abehrens <61003964+abehrens13@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:48:50 +0100 Subject: [PATCH 2/2] fix deprecated import --- .../Java/libraries/resttemplate/auth/HttpBasicAuth.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache index 5f535b3698a..b0bde6fff65 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache @@ -4,7 +4,7 @@ import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; +import java.util.Base64; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} @@ -34,6 +34,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } }