Skip to content

Commit

Permalink
Implement PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PHWaechtler committed Feb 14, 2025
1 parent 101f952 commit 154b6cc
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ public void testHistoricProcessInstanceQueryWithJobsRetrying() {
runtimeService.startProcessInstanceByKey("processWithJobsRetrying");

// then
assertEquals(0, queryWithJobsRetrying.count());
assertThat(queryWithJobsRetrying.count()).isZero();
assertThat(queryWithJobsRetrying.list()).isEmpty();

// when we have 1 instance with a job that has an exception and retries left
Expand All @@ -576,16 +576,16 @@ public void testHistoricProcessInstanceQueryWithJobsRetrying() {
executeFailingJob(failingJob);

// then
assertEquals(1, queryWithJobsRetrying.count());
assertEquals(1, queryWithJobsRetrying.list().size());
assertEquals(instanceWithRetryingJob.getId(), queryWithJobsRetrying.singleResult().getRootProcessInstanceId());
assertThat(queryWithJobsRetrying.count()).isEqualTo(1L);
assertThat(queryWithJobsRetrying.list()).hasSize(1);
assertThat(instanceWithRetryingJob.getId()).isEqualTo(queryWithJobsRetrying.singleResult().getId());

// when all retries are exhausted, so now the instance has a job with exception but no retries left
executeFailingJob(failingJob);
executeFailingJob(failingJob);

// then
assertEquals(0, queryWithJobsRetrying.count());
assertThat(queryWithJobsRetrying.count()).isZero();
assertThat(queryWithJobsRetrying.list()).isEmpty();
}

Expand Down Expand Up @@ -2731,10 +2731,10 @@ protected void executeJobForProcessInstance(String processInstanceId) {
managementService.executeJob(job.getId());
}

private void executeFailingJob(Job job){
private void executeFailingJob(Job job) {
try {
managementService.executeJob(job.getId());
} catch(RuntimeException re) {
} catch (RuntimeException re) {
// Exception expected. Do nothing
}
}
Expand Down

0 comments on commit 154b6cc

Please sign in to comment.