@Test
public void testDrainOutputToMap() {

	ExecutionContext executionContext = buildExecutionContext();
	
	Function function = newFunction(FUNCTION_ID_SUCCESS);
	((InMemoryFunctionAccessorImpl)executionContext.get(FunctionAccessor.class)).save(function);
	
	CallFunctionHandler handler = new CallFunctionHandler();
	handler.init(executionContext);
	
	Map<String, String> map = new HashMap<>();
	executionContext.getVariablesManager().putVariable(executionContext.getReport(),"map", map);
	
	CallFunction callFunction = new CallFunction();
	callFunction.setFunctionId(function.getId().toString());
	callFunction.setResultMap(new DynamicValue<String>("map"));
	
	CallFunctionReportNode node = (CallFunctionReportNode) execute(callFunction);
	Assert.assertEquals(ReportNodeStatus.PASSED, node.getStatus());
	
	Assert.assertEquals("Value1", map.get("Output1"));
}