From fe8f4559df2b85c098bc9ef91e6db3ef9b7e4cde Mon Sep 17 00:00:00 2001 From: Miklas Boskamp Date: Fri, 20 Sep 2024 10:06:11 +0200 Subject: [PATCH] cleanup smells --- .../test/history/BatchOperationJobIdTest.java | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/history/BatchOperationJobIdTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/history/BatchOperationJobIdTest.java index 2390b90952c..1b43add4030 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/history/BatchOperationJobIdTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/history/BatchOperationJobIdTest.java @@ -32,7 +32,6 @@ import org.camunda.bpm.engine.history.HistoricProcessInstanceQuery; import org.camunda.bpm.engine.impl.batch.BatchMonitorJobHandler; import org.camunda.bpm.engine.impl.batch.BatchSeedJobHandler; -import org.camunda.bpm.engine.impl.persistence.entity.JobEntity; import org.camunda.bpm.engine.migration.MigrationPlan; import org.camunda.bpm.engine.repository.ProcessDefinition; import org.camunda.bpm.engine.runtime.ActivityInstance; @@ -230,7 +229,7 @@ public void shouldSetBatchIdOnJobAndJobLog_DeleteHistoricProcessInstances() { .startEvent() .endEvent() .done()); - ProcessInstance process = runtimeService.startProcessInstanceByKey("process"); + runtimeService.startProcessInstanceByKey("process"); HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery() .processDefinitionKey("process"); @@ -392,7 +391,7 @@ public void shouldSetBatchIdOnJobAndJobLog_SetExternalTaskRetries() { public void shouldSetBatchIdOnJobAndJobLog_SetJobRetries() { // given testRule.deploy(getTimerProcess()); - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process"); + runtimeService.startProcessInstanceByKey("process"); Job timerJob = managementService.createJobQuery().singleResult(); @@ -428,7 +427,7 @@ public void shouldSetBatchIdOnJobAndJobLog_UpdateProcessInstancesSuspendState() public void shouldNotSetBatchIdOnJobOrJobLog_nonBatchJob() { // given testRule.deploy(getTimerProcess()); - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process"); + runtimeService.startProcessInstanceByKey("process"); Job timerJob = managementService.createJobQuery().singleResult(); @@ -443,22 +442,10 @@ public void shouldNotSetBatchIdOnJobOrJobLog_nonBatchJob() { // HELPER - private JobEntity getSeedJob(Batch batch) { - return (JobEntity) managementService.createJobQuery().jobDefinitionId(batch.getSeedJobDefinitionId()).singleResult(); - } - - private JobEntity getMonitorJob(Batch batch) { - return (JobEntity) managementService.createJobQuery().jobDefinitionId(batch.getMonitorJobDefinitionId()).singleResult(); - } - - private List getExecutionJobs(Batch batch) { - return (List)(List) managementService.createJobQuery().jobDefinitionId(batch.getBatchJobDefinitionId()).list(); - } - private void assertProcessedJobs(Batch batch, Map> processedJobs) { - assertThat(processedJobs.get(batchRule.SEED_JOB)).extracting("batchId").containsOnly(batch.getId()); - assertThat(processedJobs.get(batchRule.EXECUTION_JOBS)).extracting("batchId").containsOnly(batch.getId()); - assertThat(processedJobs.get(batchRule.MONITOR_JOB)).extracting("batchId").containsOnly(batch.getId()); + assertThat(processedJobs.get(BatchRule.SEED_JOB)).extracting("batchId").containsOnly(batch.getId()); + assertThat(processedJobs.get(BatchRule.EXECUTION_JOBS)).extracting("batchId").containsOnly(batch.getId()); + assertThat(processedJobs.get(BatchRule.MONITOR_JOB)).extracting("batchId").containsOnly(batch.getId()); } private void assertHistoricJobLogs(Batch batch, String expectedBatchType) {