use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldActivateSeedJobAndDefinition.
@Test
public void shouldActivateSeedJobAndDefinition() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
managementService.suspendBatchById(batch.getId());
// when
managementService.activateBatchById(batch.getId());
// then
JobDefinition seedJobDefinition = helper.getSeedJobDefinition(batch);
assertFalse(seedJobDefinition.isSuspended());
Job seedJob = helper.getSeedJob(batch);
assertFalse(seedJob.isSuspended());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method testUserOperationLogQueryByBatchEntityType.
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testUserOperationLogQueryByBatchEntityType() {
// given
Batch batch1 = helper.migrateProcessInstancesAsync(1);
Batch batch2 = helper.migrateProcessInstancesAsync(1);
// when
identityService.setAuthenticatedUserId(USER_ID);
managementService.suspendBatchById(batch1.getId());
managementService.suspendBatchById(batch2.getId());
managementService.activateBatchById(batch1.getId());
identityService.clearAuthentication();
// then
UserOperationLogQuery query = historyService.createUserOperationLogQuery().entityType(BATCH);
assertEquals(3, query.count());
assertEquals(3, query.list().size());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldCreateActivatedSeedJob.
@Test
public void shouldCreateActivatedSeedJob() {
// given
Batch batch = helper.migrateProcessInstancesAsync(2);
// when
helper.executeSeedJob(batch);
// then
Job seedJob = helper.getSeedJob(batch);
assertFalse(seedJob.isSuspended());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldCreateSuspendedSeedJob.
@Test
public void shouldCreateSuspendedSeedJob() {
// given
Batch batch = helper.migrateProcessInstancesAsync(2);
managementService.suspendBatchById(batch.getId());
// when
helper.executeSeedJob(batch);
// then
Job seedJob = helper.getSeedJob(batch);
assertTrue(seedJob.isSuspended());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldSuspendExecutionJobsAndDefinition.
@Test
public void shouldSuspendExecutionJobsAndDefinition() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
helper.executeSeedJob(batch);
// when
managementService.suspendBatchById(batch.getId());
// then
JobDefinition migrationJobDefinition = helper.getExecutionJobDefinition(batch);
assertTrue(migrationJobDefinition.isSuspended());
Job migrationJob = helper.getExecutionJobs(batch).get(0);
assertTrue(migrationJob.isSuspended());
}
Aggregations