use of org.camunda.bpm.engine.test.api.authorization.service.ExecuteQueryTaskListener in project camunda-bpm-platform by camunda.
the class DelegationAuthorizationTest method testTaskListenerExecutesQueryAfterUserCompletesTaskAsDelegateExpression.
@Deployment
public void testTaskListenerExecutesQueryAfterUserCompletesTaskAsDelegateExpression() {
// given
processEngineConfiguration.getBeans().put("myListener", new ExecuteQueryTaskListener());
startProcessInstancesByKey(DEFAULT_PROCESS_KEY, 5);
String taskId = selectAnyTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.complete(taskId);
// then
assertNotNull(MyDelegationService.CURRENT_AUTHENTICATION);
assertEquals(userId, MyDelegationService.CURRENT_AUTHENTICATION.getUserId());
assertEquals(Long.valueOf(5), MyDelegationService.INSTANCES_COUNT);
}
use of org.camunda.bpm.engine.test.api.authorization.service.ExecuteQueryTaskListener in project camunda-bpm-platform by camunda.
the class DelegationAuthorizationTest method testTaskListenerExecutesQueryAfterUserCompletesTaskAsExpression.
@Deployment
public void testTaskListenerExecutesQueryAfterUserCompletesTaskAsExpression() {
// given
processEngineConfiguration.getBeans().put("myListener", new ExecuteQueryTaskListener());
startProcessInstancesByKey(DEFAULT_PROCESS_KEY, 5);
String taskId = selectAnyTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.complete(taskId);
// then
assertNotNull(MyDelegationService.CURRENT_AUTHENTICATION);
assertEquals(userId, MyDelegationService.CURRENT_AUTHENTICATION.getUserId());
assertEquals(Long.valueOf(5), MyDelegationService.INSTANCES_COUNT);
}
Aggregations