Search in sources :

Example 1 with MyFormFieldValidator

use of org.camunda.bpm.engine.test.api.authorization.service.MyFormFieldValidator in project camunda-bpm-platform by camunda.

the class DelegationAuthorizationTest method testCustomFormFieldValidatorAsDelegateExpression.

@Deployment
public void testCustomFormFieldValidatorAsDelegateExpression() {
    // given
    processEngineConfiguration.getBeans().put("myValidator", new MyFormFieldValidator());
    startProcessInstancesByKey(DEFAULT_PROCESS_KEY, 5);
    String taskId = selectAnyTask().getId();
    createGrantAuthorization(TASK, taskId, userId, UPDATE);
    // when
    formService.submitTaskForm(taskId, null);
    // then
    assertNotNull(MyDelegationService.CURRENT_AUTHENTICATION);
    assertEquals(userId, MyDelegationService.CURRENT_AUTHENTICATION.getUserId());
    assertEquals(Long.valueOf(5), MyDelegationService.INSTANCES_COUNT);
}
Also used : MyFormFieldValidator(org.camunda.bpm.engine.test.api.authorization.service.MyFormFieldValidator) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

Deployment (org.camunda.bpm.engine.test.Deployment)1 MyFormFieldValidator (org.camunda.bpm.engine.test.api.authorization.service.MyFormFieldValidator)1