Skip to content

Commit

Permalink
Closes Taskana#2542 - Flag that counts the comments of a task has bee…
Browse files Browse the repository at this point in the history
…n added
  • Loading branch information
MM1277 committed Apr 4, 2024
1 parent eaf7d52 commit e697b96
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -93,15 +92,15 @@ void shouldNotCleanWorkbasketMarkedForDeletionIfWorkbasketHasTasks() throws Exce
@Test
void should_DeleteOldWorkbasketCleanupJobs_When_InitializingSchedule() throws Exception {

List<ScheduledJob> workbasketCleanupJobsToCreate = new ArrayList<>();
List<ScheduledJob> workbasketCleanupJobs = new ArrayList<>();
List<ScheduledJob> taskRefreshJobsToCreate = new ArrayList<>();
List<ScheduledJob> classificationChangedJobsToCreate = new ArrayList<>();

for (int i = 0; i < 10; i++) {

ScheduledJob job = new ScheduledJob();
job.setType(WorkbasketCleanupJob.class.getName());
workbasketCleanupJobsToCreate.add(job);
workbasketCleanupJobs.add(job);
ScheduledJob job1 = new ScheduledJob();
job1.setType(TaskRefreshJob.class.getName());
taskRefreshJobsToCreate.add(job1);
Expand All @@ -113,7 +112,7 @@ void should_DeleteOldWorkbasketCleanupJobs_When_InitializingSchedule() throws Ex

for (int i = 0; i < 10; i++) {

ScheduledJob job = workbasketCleanupJobsToCreate.get(i);
ScheduledJob job = workbasketCleanupJobs.get(i);
taskanaEngine.getJobService().createJob(job);
job = taskRefreshJobsToCreate.get(i);
taskanaEngine.getJobService().createJob(job);
Expand All @@ -126,12 +125,6 @@ void should_DeleteOldWorkbasketCleanupJobs_When_InitializingSchedule() throws Ex

assertThat(jobsToRun).hasSize(30);

List<ScheduledJob> workbasketCleanupJobs =
jobsToRun.stream()
.filter(
scheduledJob -> scheduledJob.getType().equals(WorkbasketCleanupJob.class.getName()))
.collect(Collectors.toList());

AbstractTaskanaJob.initializeSchedule(taskanaEngine, WorkbasketCleanupJob.class);

jobsToRun = getJobMapper(taskanaEngine).findJobsToRun(Instant.now());
Expand Down

0 comments on commit e697b96

Please sign in to comment.