From bf49d199991d3be1c7f80dcb7796996a5bcf48e7 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 16 Oct 2021 11:57:58 -0700 Subject: [PATCH] Drop dependency on Commons Codec --- .../jenkinsci/plugins/plaincredentials/SecretBytesTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/jenkinsci/plugins/plaincredentials/SecretBytesTest.java b/src/test/java/org/jenkinsci/plugins/plaincredentials/SecretBytesTest.java index 97498f2..38caa06 100644 --- a/src/test/java/org/jenkinsci/plugins/plaincredentials/SecretBytesTest.java +++ b/src/test/java/org/jenkinsci/plugins/plaincredentials/SecretBytesTest.java @@ -35,8 +35,8 @@ import java.io.ByteArrayInputStream; import java.io.File; import java.nio.charset.Charset; +import java.util.Base64; import java.util.List; -import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl; @@ -70,8 +70,8 @@ public class SecretBytesTest { @LocalData public void loadUnencrypted() throws Exception { // these are the magic strings - assumeThat(Base64.encodeBase64("This is Base64 encoded plain text\n".getBytes("UTF-8")), is( - "VGhpcyBpcyBCYXNlNjQgZW5jb2RlZCBwbGFpbiB0ZXh0Cg==".getBytes("US-ASCII"))); + assumeThat(Base64.getEncoder().encodeToString("This is Base64 encoded plain text\n".getBytes("UTF-8")), is( + "VGhpcyBpcyBCYXNlNjQgZW5jb2RlZCBwbGFpbiB0ZXh0Cg==")); // first check that the file on disk contains the unencrypted text assertThat(FileUtils.readFileToString(new File(r.jenkins.getRootDir(), "credentials.xml")),