use of org.camunda.bpm.engine.test.cmmn.tasklistener.util.FieldInjectionTaskListener in project camunda-bpm-platform by camunda.
the class TaskListenerTest method testFieldInjectionByDelegateExpression.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/tasklistener/TaskListenerTest.testFieldInjectionByDelegateExpression.cmmn" })
public void testFieldInjectionByDelegateExpression() {
// given
String caseInstanceId = caseService.withCaseDefinitionByKey("case").setVariable("myTaskListener", new FieldInjectionTaskListener()).create().getId();
String humanTaskId = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").singleResult().getId();
// then
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().caseInstanceIdIn(caseInstanceId);
assertEquals(5, query.count());
assertEquals("Hello from The Case", query.variableName("greeting").singleResult().getValue());
assertEquals("Hello World", query.variableName("helloWorld").singleResult().getValue());
assertEquals("cam", query.variableName("prefix").singleResult().getValue());
assertEquals("unda", query.variableName("suffix").singleResult().getValue());
}
Aggregations