use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldActivateExecutionJobsAndDefinition.
@Test
public void shouldActivateExecutionJobsAndDefinition() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
managementService.suspendBatchById(batch.getId());
helper.executeSeedJob(batch);
// when
managementService.activateBatchById(batch.getId());
// then
JobDefinition migrationJobDefinition = helper.getExecutionJobDefinition(batch);
assertFalse(migrationJobDefinition.isSuspended());
Job migrationJob = helper.getExecutionJobs(batch).get(0);
assertFalse(migrationJob.isSuspended());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldCreateUserOperationLogForBatchSuspension.
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void shouldCreateUserOperationLogForBatchSuspension() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
// when
identityService.setAuthenticatedUserId(USER_ID);
managementService.suspendBatchById(batch.getId());
identityService.clearAuthentication();
// then
UserOperationLogEntry entry = historyService.createUserOperationLogQuery().singleResult();
assertNotNull(entry);
assertEquals(batch.getId(), entry.getBatchId());
assertEquals(AbstractSetBatchStateCmd.SUSPENSION_STATE_PROPERTY, entry.getProperty());
assertNull(entry.getOrgValue());
assertEquals(SuspensionState.SUSPENDED.getName(), entry.getNewValue());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldActivateMonitorJobAndDefinition.
@Test
public void shouldActivateMonitorJobAndDefinition() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
managementService.suspendBatchById(batch.getId());
helper.executeSeedJob(batch);
// when
managementService.activateBatchById(batch.getId());
// then
JobDefinition monitorJobDefinition = helper.getMonitorJobDefinition(batch);
assertFalse(monitorJobDefinition.isSuspended());
Job monitorJob = helper.getMonitorJob(batch);
assertFalse(monitorJob.isSuspended());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchPriorityTest method seedJobShouldGetPriorityFromOverridingJobDefinitionPriority.
@Test
public void seedJobShouldGetPriorityFromOverridingJobDefinitionPriority() {
// given
Batch batch = helper.migrateProcessInstancesAsync(2);
JobDefinition seedJobDefinition = helper.getSeedJobDefinition(batch);
managementService.setOverridingJobPriorityForJobDefinition(seedJobDefinition.getId(), CUSTOM_PRIORITY);
// when
helper.executeSeedJob(batch);
// then
Job seedJob = helper.getSeedJob(batch);
assertEquals(CUSTOM_PRIORITY, seedJob.getPriority());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchPriorityTest method monitorJobShouldGetPriorityOverridingJobDefinitionPriority.
@Test
public void monitorJobShouldGetPriorityOverridingJobDefinitionPriority() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
JobDefinition monitorJobDefinition = helper.getMonitorJobDefinition(batch);
managementService.setOverridingJobPriorityForJobDefinition(monitorJobDefinition.getId(), CUSTOM_PRIORITY);
// when
helper.executeSeedJob(batch);
// then
Job monitorJob = helper.getMonitorJob(batch);
assertEquals(CUSTOM_PRIORITY, monitorJob.getPriority());
}
Aggregations