|
4 | 4 | import org.junit.Assert; |
5 | 5 | import org.junit.Before; |
6 | 6 | import org.junit.Test; |
| 7 | +import org.kohsuke.github.GHWorkflowJob.Step; |
7 | 8 | import org.kohsuke.github.GHWorkflowRun.Conclusion; |
8 | 9 | import org.kohsuke.github.GHWorkflowRun.Status; |
9 | | -import org.kohsuke.github.GHWorkflowRunJob.Step; |
10 | 10 | import org.kohsuke.github.function.InputStreamFunction; |
11 | 11 |
|
12 | 12 | import java.io.IOException; |
@@ -339,30 +339,30 @@ public void testJobs() throws IOException { |
339 | 339 | latestPreexistingWorkflowRunId).orElseThrow( |
340 | 340 | () -> new IllegalStateException("We must have a valid workflow run starting from here")); |
341 | 341 |
|
342 | | - List<GHWorkflowRunJob> jobs = workflowRun.listJobs() |
| 342 | + List<GHWorkflowJob> jobs = workflowRun.listJobs() |
343 | 343 | .toList() |
344 | 344 | .stream() |
345 | 345 | .sorted((j1, j2) -> j1.getName().compareTo(j2.getName())) |
346 | 346 | .collect(Collectors.toList()); |
347 | 347 |
|
348 | 348 | assertThat(jobs.size(), is(2)); |
349 | 349 |
|
350 | | - GHWorkflowRunJob job1 = jobs.get(0); |
| 350 | + GHWorkflowJob job1 = jobs.get(0); |
351 | 351 | checkJobProperties(workflowRun.getId(), job1, "job1"); |
352 | 352 | String fullLogContent = job1.downloadLogs(getLogTextInputStreamFunction()); |
353 | 353 | assertThat(fullLogContent, containsString("Hello from job1!")); |
354 | 354 |
|
355 | | - GHWorkflowRunJob job2 = jobs.get(1); |
| 355 | + GHWorkflowJob job2 = jobs.get(1); |
356 | 356 | checkJobProperties(workflowRun.getId(), job2, "job2"); |
357 | 357 | fullLogContent = job2.downloadLogs(getLogTextInputStreamFunction()); |
358 | 358 | assertThat(fullLogContent, containsString("Hello from job2!")); |
359 | 359 |
|
360 | | - // while we have a job around, test GHRepository#getWorkflowRunJob(id) |
361 | | - GHWorkflowRunJob job1ById = repo.getWorkflowRunJob(job1.getId()); |
| 360 | + // while we have a job around, test GHRepository#getWorkflowJob(id) |
| 361 | + GHWorkflowJob job1ById = repo.getWorkflowJob(job1.getId()); |
362 | 362 | checkJobProperties(workflowRun.getId(), job1ById, "job1"); |
363 | 363 |
|
364 | 364 | // Also test listAllJobs() works correctly |
365 | | - List<GHWorkflowRunJob> allJobs = workflowRun.listAllJobs().withPageSize(10).iterator().nextPage(); |
| 365 | + List<GHWorkflowJob> allJobs = workflowRun.listAllJobs().withPageSize(10).iterator().nextPage(); |
366 | 366 | assertThat(allJobs.size(), greaterThanOrEqualTo(2)); |
367 | 367 | } |
368 | 368 |
|
@@ -468,8 +468,7 @@ private static void checkArtifactProperties(GHArtifact artifact, String artifact |
468 | 468 | assertFalse(artifact.isExpired()); |
469 | 469 | } |
470 | 470 |
|
471 | | - private static void checkJobProperties(long workflowRunId, GHWorkflowRunJob job, String jobName) |
472 | | - throws IOException { |
| 471 | + private static void checkJobProperties(long workflowRunId, GHWorkflowJob job, String jobName) throws IOException { |
473 | 472 | assertNotNull(job.getId()); |
474 | 473 | assertNotNull(job.getNodeId()); |
475 | 474 | assertEquals(REPO_NAME, job.getRepository().getFullName()); |
|
0 commit comments