use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class JobDefinitionAuthorizationTest method testSuspendIncludingJobsByProcessDefinitionIdWithUpdateInstancePermissionOnProcessDefinition.
public void testSuspendIncludingJobsByProcessDefinitionIdWithUpdateInstancePermissionOnProcessDefinition() {
// given
String processDefinitionId = selectProcessDefinitionByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
String processInstanceId = startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, TIMER_BOUNDARY_PROCESS_KEY, userId, UPDATE, UPDATE_INSTANCE);
// when
managementService.suspendJobDefinitionByProcessDefinitionId(processDefinitionId, true);
// then
JobDefinition jobDefinition = selectJobDefinitionByProcessDefinitionKey(TIMER_BOUNDARY_PROCESS_KEY);
assertNotNull(jobDefinition);
assertTrue(jobDefinition.isSuspended());
Job job = selectJobByProcessInstanceId(processInstanceId);
assertNotNull(job);
assertTrue(job.isSuspended());
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class JobDefinitionAuthorizationTest method testSuspendByProcessDefinitionIdWithUpdatePermissionOnAnyProcessDefinition.
public void testSuspendByProcessDefinitionIdWithUpdatePermissionOnAnyProcessDefinition() {
// given
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, UPDATE);
String processDefinitionId = selectProcessDefinitionByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
// when
managementService.suspendJobDefinitionByProcessDefinitionId(processDefinitionId);
// then
JobDefinition jobDefinition = selectJobDefinitionByProcessDefinitionKey(TIMER_BOUNDARY_PROCESS_KEY);
assertNotNull(jobDefinition);
assertTrue(jobDefinition.isSuspended());
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class JobDefinitionAuthorizationTest method testActivateByIdWithUpdatePermissionOnAnyProcessDefinition.
public void testActivateByIdWithUpdatePermissionOnAnyProcessDefinition() {
// given
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, UPDATE);
String jobDefinitionId = selectJobDefinitionByProcessDefinitionKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
suspendJobDefinitionById(jobDefinitionId);
// when
managementService.activateJobDefinitionById(jobDefinitionId);
// then
JobDefinition jobDefinition = selectJobDefinitionByProcessDefinitionKey(TIMER_BOUNDARY_PROCESS_KEY);
assertNotNull(jobDefinition);
assertFalse(jobDefinition.isSuspended());
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class JobDefinitionAuthorizationTest method testActivateByProcessDefinitionIdWithUpdatePermissionOnAnyProcessDefinition.
public void testActivateByProcessDefinitionIdWithUpdatePermissionOnAnyProcessDefinition() {
// given
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, UPDATE);
String processDefinitionId = selectProcessDefinitionByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
suspendJobDefinitionByProcessDefinitionId(processDefinitionId);
// when
managementService.activateJobDefinitionByProcessDefinitionId(processDefinitionId);
// then
JobDefinition jobDefinition = selectJobDefinitionByProcessDefinitionKey(TIMER_BOUNDARY_PROCESS_KEY);
assertNotNull(jobDefinition);
assertFalse(jobDefinition.isSuspended());
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class JobDefinitionAuthorizationTest method testActivateIncludingJobsByProcessDefinitionIdWithUpdatePermissionOnAnyProcessInstance.
public void testActivateIncludingJobsByProcessDefinitionIdWithUpdatePermissionOnAnyProcessInstance() {
// given
String processDefinitionId = selectProcessDefinitionByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
String processInstanceId = startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
suspendJobDefinitionIncludingJobsByProcessDefinitionId(processDefinitionId);
createGrantAuthorization(PROCESS_DEFINITION, TIMER_BOUNDARY_PROCESS_KEY, userId, UPDATE);
createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, UPDATE);
// when
managementService.activateJobDefinitionByProcessDefinitionId(processDefinitionId, true);
// then
JobDefinition jobDefinition = selectJobDefinitionByProcessDefinitionKey(TIMER_BOUNDARY_PROCESS_KEY);
assertNotNull(jobDefinition);
assertFalse(jobDefinition.isSuspended());
Job job = selectJobByProcessInstanceId(processInstanceId);
assertNotNull(job);
assertFalse(job.isSuspended());
}
Aggregations