Skip to content

Commit

Permalink
Diagnostics.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Nov 14, 2018
1 parent 351dbb3 commit e50a5f5
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package org.jenkinsci.plugins.plaincredentials;

import com.cloudbees.plugins.credentials.CredentialsMatchers;
import com.cloudbees.plugins.credentials.CredentialsNameProvider;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.SecretBytes;
import com.cloudbees.plugins.credentials.SystemCredentialsProvider;
Expand All @@ -46,6 +47,7 @@
import org.jvnet.hudson.test.recipes.LocalData;

import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently;
import java.util.stream.Collectors;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.junit.Assume.*;
Expand Down Expand Up @@ -108,6 +110,8 @@ public void migrateLegacyData() throws Exception {
assertThat(FileUtils.readFileToString(new File(r.jenkins.getRootDir(), "credentials.xml")),
allOf(containsString("</data>"), not(containsString("</secretBytes>"))));

System.out.println("Loaded: " + SystemCredentialsProvider.getInstance().getCredentials().stream().map(CredentialsNameProvider::name).collect(Collectors.toList()));

// get the credential instance under test
FileCredentials c = CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentials(
Expand Down

0 comments on commit e50a5f5

Please sign in to comment.