|
5 | 5 | import com.cloudbees.plugins.credentials.CredentialsStore;
|
6 | 6 | import com.cloudbees.plugins.credentials.SystemCredentialsProvider;
|
7 | 7 | import com.cloudbees.plugins.credentials.common.StandardCredentials;
|
8 |
| -import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials; |
9 | 8 | import com.cloudbees.plugins.credentials.domains.Domain;
|
10 | 9 | import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
|
11 | 10 | import org.htmlunit.html.HtmlPage;
|
@@ -2916,30 +2915,6 @@ public void testCommitMessageIsPrintedToLogs() throws Exception {
|
2916 | 2915 | r.waitForMessage("Commit message: \"test commit\"", run);
|
2917 | 2916 | }
|
2918 | 2917 |
|
2919 |
| - @Issue("JENKINS-73677") |
2920 |
| - @Test |
2921 |
| - public void testExtensionsDecorateClientAfterSettingCredentials() throws Exception { |
2922 |
| - assumeTrue("Test class max time " + MAX_SECONDS_FOR_THESE_TESTS + " exceeded", isTimeAvailable()); |
2923 |
| - FreeStyleProject project = setupSimpleProject("master"); |
2924 |
| - StandardCredentials extensionCredentials = createCredential(CredentialsScope.GLOBAL, "github"); |
2925 |
| - store.addCredentials(Domain.global(), extensionCredentials); |
2926 |
| - // setup global config |
2927 |
| - List<UserRemoteConfig> remoteConfigs = GitSCM.createRepoList("https://github.com/jenkinsci/git-plugin", null); |
2928 |
| - project.setScm(new GitSCM( |
2929 |
| - remoteConfigs, |
2930 |
| - Collections.singletonList(new BranchSpec("master")), |
2931 |
| - false, |
2932 |
| - null, |
2933 |
| - null, |
2934 |
| - null, |
2935 |
| - List.of(new TestSetCredentialsGitSCMExtension((StandardUsernameCredentials) extensionCredentials)))); |
2936 |
| - sampleRepo.init(); |
2937 |
| - sampleRepo.write("file", "v1"); |
2938 |
| - sampleRepo.git("commit", "--all", "--message=test commit"); |
2939 |
| - Run<?, ?> run = r.buildAndAssertSuccess(project); |
2940 |
| - r.waitForMessage("using GIT_ASKPASS to set credentials " + extensionCredentials.getDescription(), run); |
2941 |
| - } |
2942 |
| - |
2943 | 2918 | private void setupJGit(GitSCM git) {
|
2944 | 2919 | git.gitTool="jgit";
|
2945 | 2920 | r.jenkins.getDescriptorByType(GitTool.DescriptorImpl.class).setInstallations(new JGitTool(Collections.emptyList()));
|
@@ -2973,19 +2948,4 @@ private boolean isWindows() {
|
2973 | 2948 | private StandardCredentials createCredential(CredentialsScope scope, String id) {
|
2974 | 2949 | return new UsernamePasswordCredentialsImpl(scope, id, "desc: " + id, "username", "password");
|
2975 | 2950 | }
|
2976 |
| - |
2977 |
| - public static class TestSetCredentialsGitSCMExtension extends GitSCMExtension { |
2978 |
| - |
2979 |
| - private final StandardUsernameCredentials credentials; |
2980 |
| - |
2981 |
| - public TestSetCredentialsGitSCMExtension(StandardUsernameCredentials credentials) { |
2982 |
| - this.credentials = credentials; |
2983 |
| - } |
2984 |
| - |
2985 |
| - @Override |
2986 |
| - public GitClient decorate(GitSCM scm, GitClient git) throws GitException { |
2987 |
| - git.setCredentials(credentials); |
2988 |
| - return git; |
2989 |
| - } |
2990 |
| - } |
2991 | 2951 | }
|
0 commit comments