use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class MultiTenancyBatchTest method testSuspendBatch.
@Test
public void testSuspendBatch() {
// given
Batch batch = batchHelper.migrateProcessInstanceAsync(tenant1Definition, tenant1Definition);
// when
identityService.setAuthentication("user", null, singletonList(TENANT_ONE));
managementService.suspendBatchById(batch.getId());
identityService.clearAuthentication();
// then
batch = managementService.createBatchQuery().batchId(batch.getId()).singleResult();
Assert.assertTrue(batch.isSuspended());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class MultiTenancyBatchTest method testActivateBatch.
@Test
public void testActivateBatch() {
// given
Batch batch = batchHelper.migrateProcessInstanceAsync(tenant1Definition, tenant1Definition);
managementService.suspendBatchById(batch.getId());
// when
identityService.setAuthentication("user", null, singletonList(TENANT_ONE));
managementService.activateBatchById(batch.getId());
identityService.clearAuthentication();
// then
batch = managementService.createBatchQuery().batchId(batch.getId()).singleResult();
Assert.assertFalse(batch.isSuspended());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchQueryTest method testBatchQueryById.
@Test
public void testBatchQueryById() {
// given
Batch batch1 = helper.migrateProcessInstancesAsync(1);
helper.migrateProcessInstancesAsync(1);
// when
Batch resultBatch = managementService.createBatchQuery().batchId(batch1.getId()).singleResult();
// then
Assert.assertNotNull(resultBatch);
Assert.assertEquals(batch1.getId(), resultBatch.getId());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchQueryTest method testBatchQueryBySuspendedBatches.
@Test
public void testBatchQueryBySuspendedBatches() {
// given
Batch batch1 = helper.migrateProcessInstancesAsync(1);
Batch batch2 = helper.migrateProcessInstancesAsync(1);
helper.migrateProcessInstancesAsync(1);
// when
managementService.suspendBatchById(batch1.getId());
managementService.suspendBatchById(batch2.getId());
managementService.activateBatchById(batch1.getId());
// then
BatchQuery query = managementService.createBatchQuery().suspended();
Assert.assertEquals(1, query.count());
Assert.assertEquals(1, query.list().size());
Assert.assertEquals(batch2.getId(), query.singleResult().getId());
}
use of org.camunda.bpm.engine.batch.Batch in project camunda-bpm-platform by camunda.
the class BatchSuspensionTest method shouldCreateSuspendedMonitorJob.
@Test
public void shouldCreateSuspendedMonitorJob() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
managementService.suspendBatchById(batch.getId());
// when
helper.executeSeedJob(batch);
// then
Job monitorJob = helper.getMonitorJob(batch);
assertTrue(monitorJob.isSuspended());
}
Aggregations