Skip to content

Commit

Permalink
Drop dependency on Commons Codec
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Oct 16, 2021
1 parent 83be2ca commit bf49d19
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")),
Expand Down

0 comments on commit bf49d19

Please sign in to comment.