diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java index 2721158df3..dfee573df5 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java @@ -14,6 +14,7 @@ import com.cloudbees.plugins.credentials.common.StandardCredentials; import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; +import hudson.model.Descriptor.FormException; import hudson.model.Fingerprint; import hudson.util.LogTaskListener; import java.io.File; @@ -137,7 +138,7 @@ public CredentialsTest( } @Before - public void setUp() throws IOException, InterruptedException { + public void setUp() throws FormException, IOException, InterruptedException { git = null; repo = tempFolder.newFolder(); /* Use a repo with a special character in name - JENKINS-43931 */ @@ -212,7 +213,8 @@ private BasicSSHUserPrivateKey newPrivateKeyCredential(String username, File pri return new BasicSSHUserPrivateKey(scope, id, username, privateKeySource, this.passphrase, description); } - private StandardUsernamePasswordCredentials newUsernamePasswordCredential(String username, String password) { + private StandardUsernamePasswordCredentials newUsernamePasswordCredential(String username, String password) + throws FormException { CredentialsScope scope = CredentialsScope.GLOBAL; String id = "username-" + username + "-password-" + password + random.nextInt(); return new UsernamePasswordCredentialsImpl(scope, id, "desc: " + id, username, password); diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/RemoteGitImplTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/RemoteGitImplTest.java index 485c4f5b4c..817103faa6 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/RemoteGitImplTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/RemoteGitImplTest.java @@ -87,7 +87,7 @@ public void testClearCredentials() { } @Test - public void testAddCredentials() { + public void testAddCredentials() throws Exception { CredentialsScope scope = CredentialsScope.GLOBAL; String password = "password"; String url = "https://github.com/jenkinsci/git-client-plugin"; @@ -99,7 +99,7 @@ public void testAddCredentials() { } @Test - public void testSetCredentials() { + public void testSetCredentials() throws Exception { CredentialsScope scope = CredentialsScope.GLOBAL; String password = "password"; String username = "user"; @@ -110,7 +110,7 @@ public void testSetCredentials() { } @Test - public void testAddDefaultCredentials() { + public void testAddDefaultCredentials() throws Exception { CredentialsScope scope = CredentialsScope.GLOBAL; String password = "password"; String username = "user";