@Test
public void test() {

	ExecutionContext context = newExecutionContext();
	Return r = new Return();
	r.setOutput(new DynamicValue<String>("{\"Result\":{\"dynamic\":true,\"expression\":\"input.Input1\"}}"));
	
	Plan compositePlan = PlanBuilder.create().startBlock(BaseArtefacts.sequence()).add(r).endBlock().build();
	context.getPlanAccessor().save(compositePlan);
	
	ReportNode parentNode = new ReportNode();
	context.getReportNodeAccessor().save(parentNode);
	
	ArtefactFunctionHandler handler = createArtefactFunctionHandler(context);
	
	Input<JsonObject> input = new Input<>();
	input.setPayload(Json.createObjectBuilder().add("Input1", "InputValue1").build());
	Map<String, String> properties = getInputProperties(compositePlan, parentNode);
	input.setProperties(properties);
	Output<JsonObject> output = handler.handle(input);
	
	Assert.assertNull(output.getError());
	Assert.assertEquals("InputValue1", output.getPayload().getString("Result"));
	
	AtomicInteger count = new AtomicInteger(0);
	context.getReportNodeAccessor().getAll().forEachRemaining(n->count.incrementAndGet());
	Assert.assertEquals(3, count.get());
}