Skip to content

Commit

Permalink
Prepare tests for newer core/BOM (#2586)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Nov 20, 2024
1 parent be4d0c9 commit dfe0e0b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
import edu.umd.cs.findbugs.annotations.NonNull;
import jenkins.branch.BranchProperty;
Expand Down Expand Up @@ -135,7 +134,7 @@ public void jobRunEvents() throws IOException, ExecutionException, InterruptedEx
}

@Test
public void pipelineWithInput() throws IOException, ExecutionException, InterruptedException, TimeoutException {
public void pipelineWithInput() throws Exception {
final OneShotEvent success = new OneShotEvent();

String script = "node {\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class CredentialApiTest extends PipelineBaseTest {

@Test
public void listCredentials() throws IOException {
public void listCredentials() throws Exception {
SystemCredentialsProvider.ProviderImpl system = ExtensionList.lookup(CredentialsProvider.class).get(SystemCredentialsProvider.ProviderImpl.class);
CredentialsStore systemStore = system.getStore(j.getInstance());
systemStore.addDomain(new Domain("domain1", null, null));
Expand Down Expand Up @@ -59,7 +59,7 @@ public void listCredentials() throws IOException {
}

@Test
public void listAllCredentials() throws IOException {
public void listAllCredentials() throws Exception {
SystemCredentialsProvider.ProviderImpl system = ExtensionList.lookup(CredentialsProvider.class).get(SystemCredentialsProvider.ProviderImpl.class);
CredentialsStore systemStore = system.getStore(j.getInstance());
systemStore.addDomain(new Domain("domain1", null, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ private WorkflowRun createAndRunJob(String jobName, String jenkinsFileName, Resu
return job.getLastBuild();
}

private WorkflowJob createJob(String jobName, String jenkinsFileName) throws java.io.IOException {
private WorkflowJob createJob(String jobName, String jenkinsFileName) throws Exception {
WorkflowJob job = j.createProject(WorkflowJob.class, jobName);

URL resource = getClass().getResource(jenkinsFileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.junit.Test;
import org.jvnet.hudson.test.MockFolder;

import java.io.IOException;
import java.util.List;

/**
Expand All @@ -28,7 +27,7 @@ public void setup() throws Exception {
}

@Test
public void nestedFolderJobLinkResolveTest() throws IOException {
public void nestedFolderJobLinkResolveTest() throws Exception {
Project f = j.createFreeStyleProject("fstyle1");
MockFolder folder1 = j.createFolder("folder1");
Project p1 = folder1.createProject(FreeStyleProject.class, "test1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ protected User login() throws IOException {
return login("bob", "Bob Smith", "[email protected]");
}

protected WorkflowJob createWorkflowJobWithJenkinsfile(Class<?> contextClass, String jenkinsFileName) throws java.io.IOException {
protected WorkflowJob createWorkflowJobWithJenkinsfile(Class<?> contextClass, String jenkinsFileName) throws Exception {
WorkflowJob p = j.createProject(WorkflowJob.class, "project-" + UUID.randomUUID());
URL resource = contextClass.getResource(jenkinsFileName);
String jenkinsFile = IOUtils.toString(resource, StandardCharsets.UTF_8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testGeneratedAnalyticsEventWithScriptedFunction() throws Exception {
Assert.assertEquals("runResult", "SUCCESS", properties.get("runResult"));
}

private void createAndRunPipeline(String jenkinsFileName) throws java.io.IOException, InterruptedException, java.util.concurrent.ExecutionException {
private void createAndRunPipeline(String jenkinsFileName) throws Exception {
// Create the pipeline and run it
WorkflowJob scriptedSingle = createWorkflowJobWithJenkinsfile(getClass(), jenkinsFileName);
WorkflowRun scriptedSingleRun = scriptedSingle.scheduleBuild2(0, new CauseAction()).waitForStart();
Expand Down

0 comments on commit dfe0e0b

Please sign in to comment.