diff --git a/src/main/java/hudson/plugins/accurev/AccurevSCM.java b/src/main/java/hudson/plugins/accurev/AccurevSCM.java index 98471e41..4b8cf91f 100644 --- a/src/main/java/hudson/plugins/accurev/AccurevSCM.java +++ b/src/main/java/hudson/plugins/accurev/AccurevSCM.java @@ -870,10 +870,10 @@ public StandardUsernamePasswordCredentials getCredentials() { return null; } else { return CredentialsMatchers.firstOrNull( - CredentialsProvider.lookupCredentials( + CredentialsProvider.lookupCredentialsInItemGroup( StandardUsernamePasswordCredentials.class, Jenkins.get(), - ACL.SYSTEM, + ACL.SYSTEM2, URIRequirementBuilder.fromUri("").withHostnamePort(host, port).build()), CredentialsMatchers.withId(credentialsId)); } @@ -971,10 +971,10 @@ public boolean migrateCredentials() { fixNull(URIRequirementBuilder.fromUri("").withHostnamePort(host, port).build()); List credentials = CredentialsMatchers.filter( - CredentialsProvider.lookupCredentials( + CredentialsProvider.lookupCredentialsInItemGroup( StandardUsernamePasswordCredentials.class, Jenkins.get(), - ACL.SYSTEM, + ACL.SYSTEM2, domainRequirements), CredentialsMatchers.withUsername(username)); for (StandardUsernamePasswordCredentials cred : credentials) { @@ -1034,10 +1034,11 @@ public ListBoxModel doFillCredentialsIdItems( if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) { return new StandardListBoxModel().includeCurrentValue(credentialsId); } + return new StandardListBoxModel() .includeEmptyValue() .includeMatchingAs( - ACL.SYSTEM, + ACL.SYSTEM2, Jenkins.get(), StandardUsernamePasswordCredentials.class, URIRequirementBuilder.fromUri("").withHostnamePort(host, port).build(), diff --git a/src/test/java/hudson/plugins/accurev/ConfigurationAsCodeTest.java b/src/test/java/hudson/plugins/accurev/ConfigurationAsCodeTest.java index 6773d276..f865e212 100644 --- a/src/test/java/hudson/plugins/accurev/ConfigurationAsCodeTest.java +++ b/src/test/java/hudson/plugins/accurev/ConfigurationAsCodeTest.java @@ -1,7 +1,7 @@ package hudson.plugins.accurev; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import io.jenkins.plugins.casc.ConfigurationAsCode; import io.jenkins.plugins.casc.ConfiguratorException;