MappingAwareUserTaskBehavior extends UserTaskActivityBehavior { @Override protected Map<String, Object> calculateOutBoundVariables(DelegateExecution execution, Map<String, Object> taskCompleteVariables) { return variablesCalculator.calculateOutPutVariables(buildMappingExecutionContext(execution), taskCompleteVariables); } MappingAwareUserTaskBehavior(UserTask userTask, VariablesCalculator variablesCalculator);   }
@Test public void calculateOutBoundVariablesShouldReturnValueFromMappingProvider() { DelegateExecution execution = buildExecution(); Map<String, Object> availableVariables = emptyMap(); Map<String, Object> providerVariables = singletonMap("var", "value"); given(mappingProvider.calculateOutPutVariables(buildMappingExecutionContext(execution), availableVariables)) .willReturn(providerVariables); Map<String, Object> outBoundVariables = behavior.calculateOutBoundVariables(execution, availableVariables); assertThat(outBoundVariables).isEqualTo(providerVariables); }