use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyJobDefinitionSuspensionStateTest method suspendJobDefinitionNoAuthenticatedTenants.
@Test
public void suspendJobDefinitionNoAuthenticatedTenants() {
// given activated job definitions
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getIdentityService().setAuthentication("user", null, null);
engineRule.getManagementService().updateJobDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
engineRule.getIdentityService().clearAuthentication();
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.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionSuspensionStateTest method activateProcessDefinitionIncludingJobDefinitionsForTenant.
@Test
public void activateProcessDefinitionIncludingJobDefinitionsForTenant() {
// given suspended jobs
engineRule.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
assertThat(query.active().count(), is(0L));
assertThat(query.suspended().count(), is(3L));
engineRule.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionTenantId(TENANT_ONE).activate();
assertThat(query.suspended().count(), is(2L));
assertThat(query.active().count(), is(1L));
assertThat(query.active().tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionSuspensionStateTest method activateProcessDefinitionIncludingJobDefinitionsForAllTenants.
@Test
public void activateProcessDefinitionIncludingJobDefinitionsForAllTenants() {
// given suspended jobs
engineRule.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
assertThat(query.active().count(), is(0L));
assertThat(query.suspended().count(), is(3L));
engineRule.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).activate();
assertThat(query.suspended().count(), is(0L));
assertThat(query.active().count(), is(3L));
}
use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionSuspensionStateTest method suspendProcessDefinitionIncludingJobDefinitionsForAllTenants.
@Test
public void suspendProcessDefinitionIncludingJobDefinitionsForAllTenants() {
// given activated jobs
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
assertThat(query.active().count(), is(0L));
assertThat(query.suspended().count(), is(3L));
}
use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.
the class JobDefinitionAuthorizationTest method testQueryWithReadPermissionOnAnyProcessDefinition.
public void testQueryWithReadPermissionOnAnyProcessDefinition() {
// given
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ);
// when
JobDefinitionQuery query = managementService.createJobDefinitionQuery();
// then
verifyQueryResults(query, 2);
}
Aggregations