Skip to content

Commit

Permalink
Stop using deprecated Base64 class (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Dec 19, 2024
1 parent 48f0e67 commit a860001
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.sonymobile.jenkins.plugins.kerberossso.ioc.KerberosAuthenticator;
import hudson.FilePath;
import hudson.model.User;
import hudson.remoting.Base64;
import hudson.security.SecurityRealm;
import hudson.util.PluginServletFilter;
import jenkins.model.GlobalConfiguration;
Expand Down Expand Up @@ -60,6 +59,7 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.Base64;
import java.util.Collections;

import static org.hamcrest.MatcherAssert.assertThat;
Expand Down Expand Up @@ -336,7 +336,7 @@ public void redirectBackWithContextPath() throws Exception {

private void injectDummyCredentials() {
String dummyRealmCreds = "mockUser:mockUser";
wc.addRequestHeader("Authorization", "Basic " + Base64.encode(dummyRealmCreds.getBytes()));
wc.addRequestHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(dummyRealmCreds.getBytes()));
}

private Matcher<String> authenticated() {
Expand Down

0 comments on commit a860001

Please sign in to comment.