From 81d2d09f260ec64064151d5f042ca1acce505a5a Mon Sep 17 00:00:00 2001 From: Vito De Tullio Date: Tue, 10 Oct 2023 13:36:45 +0200 Subject: [PATCH] replace deprecated org.springframework.util.Base64Utils with Base64 From https://github.com/swagger-api/swagger-codegen/pull/12081 --- .../Java/libraries/resttemplate/auth/HttpBasicAuth.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/handlebars/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache b/src/main/resources/handlebars/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache index 5f535b3698..a438340836 100644 --- a/src/main/resources/handlebars/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache +++ b/src/main/resources/handlebars/Java/libraries/resttemplate/auth/HttpBasicAuth.mustache @@ -2,9 +2,9 @@ package {{invokerPackage}}.auth; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; +import java.util.Base64; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; 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))); } }