Replace Base64Utils with JDK's Base64

See gh-33967
This commit is contained in:
Johnny Lim
2023-01-25 01:44:46 +09:00
committed by Moritz Halbritter
parent b62b88372f
commit bc7fc90550
23 changed files with 73 additions and 67 deletions

View File

@@ -16,6 +16,8 @@
package io.spring.concourse.releasescripts.artifactory;
import java.util.Base64;
import io.spring.concourse.releasescripts.ReleaseInfo;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
@@ -29,7 +31,6 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.test.web.client.response.DefaultResponseCreator;
import org.springframework.util.Base64Utils;
import org.springframework.web.client.HttpClientErrorException;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
@@ -69,7 +70,7 @@ class ArtifactoryServiceTests {
.andExpect(method(HttpMethod.POST))
.andExpect(content().json(
"{\"status\": \"staged\", \"sourceRepo\": \"libs-staging-local\", \"targetRepo\": \"libs-milestone-local\"}"))
.andExpect(header("Authorization", "Basic " + Base64Utils.encodeToString(String
.andExpect(header("Authorization", "Basic " + Base64.getEncoder().encodeToString(String
.format("%s:%s", this.properties.getUsername(), this.properties.getPassword()).getBytes())))
.andExpect(header("Content-Type", MediaType.APPLICATION_JSON.toString())).andRespond(withSuccess());
this.service.promote("libs-milestone-local", getReleaseInfo());