@Test
public void testError() {

	ExecutionContext context = newExecutionContext();
	Script script = new Script();
	script.setScript("output.setError('MyError'");
	
	Plan compositePlan = PlanBuilder.create().startBlock(BaseArtefacts.sequence()).add(script).endBlock().build();
	context.getPlanAccessor().save(compositePlan);
	
	ReportNode parentNode = new ReportNode();
	context.getReportNodeAccessor().save(parentNode);
	
	ArtefactFunctionHandler handler = createArtefactFunctionHandler(context);
	
	Input<JsonObject> input = new Input<>();
	Map<String, String> properties = getInputProperties(compositePlan, parentNode);
	input.setProperties(properties);
	Output<JsonObject> output = handler.handle(input);
	
	Assert.assertEquals("Error in composite keyword", output.getError().getMsg());
	Assert.assertEquals(ErrorType.TECHNICAL, output.getError().getType());
}