Skip to content

Commit

Permalink
Merge pull request #26 from basil/commons-codec
Browse files Browse the repository at this point in the history
Drop dependency on Commons Codec
  • Loading branch information
daniel-beck authored Jan 24, 2022
2 parents c6f34b8 + bf49d19 commit 944368c
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 944368c

Please sign in to comment.