use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobDefinitionSuspensionStateTest method suspendJobDefinitionIncludingJobsForNonTenant.
@Test
public void suspendJobDefinitionIncludingJobsForNonTenant() {
// given activated job definitions
JobQuery query = engineRule.getManagementService().createJobQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getManagementService().updateJobDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().includeJobs(true).suspend();
assertThat(query.active().count(), is(2L));
assertThat(query.suspended().count(), is(1L));
assertThat(query.suspended().withoutTenantId().count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobDefinitionSuspensionStateTest method activateJobDefinitionIncludingJobsForNonTenant.
@Test
public void activateJobDefinitionIncludingJobsForNonTenant() {
// given suspend job definitions
engineRule.getManagementService().updateJobDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).includeJobs(true).suspend();
JobQuery query = engineRule.getManagementService().createJobQuery();
assertThat(query.suspended().count(), is(3L));
assertThat(query.active().count(), is(0L));
engineRule.getManagementService().updateJobDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().includeJobs(true).activate();
assertThat(query.suspended().count(), is(2L));
assertThat(query.active().count(), is(1L));
assertThat(query.active().withoutTenantId().count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobSuspensionStateTest method suspendAndActivateJobsForAllTenants.
@Test
public void suspendAndActivateJobsForAllTenants() {
// given activated jobs
JobQuery query = engineRule.getManagementService().createJobQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
// first suspend
engineRule.getManagementService().updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
assertThat(query.active().count(), is(0L));
assertThat(query.suspended().count(), is(3L));
// then activate
engineRule.getManagementService().updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).activate();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobSuspensionStateTest method suspendJobForTenant.
@Test
public void suspendJobForTenant() {
// given activated jobs
JobQuery query = engineRule.getManagementService().createJobQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getManagementService().updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionTenantId(TENANT_ONE).suspend();
assertThat(query.active().count(), is(2L));
assertThat(query.suspended().count(), is(1L));
assertThat(query.suspended().tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobSuspensionStateTest method suspendJobsForNonTenant.
@Test
public void suspendJobsForNonTenant() {
// given activated jobs
JobQuery query = engineRule.getManagementService().createJobQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getManagementService().updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().suspend();
assertThat(query.active().count(), is(2L));
assertThat(query.suspended().count(), is(1L));
assertThat(query.suspended().withoutTenantId().count(), is(1L));
}
Aggregations