AddContentActionHandler extends ExpressionBasedActionHandler { @Override public List<ConfigMessage> init(Processor processor) { List<ConfigMessage> configMessages = super.init(processor); AddContentAction action = (AddContentAction) getAction(); if (action.getName() == null || action.getName().trim().isEmpty()) { String message = "Name must be specified"; log.severe(processor.getDescription() + ":" + getAction().getDescription() + ":" + message); ConfigMessage configMessage = new ConfigMessage(); configMessage.setSeverity(Severity.Error); configMessage.setMessage(message); configMessage.setField("name"); configMessage.setProcessor(processor.getDescription()); configMessage.setAction(action.getDescription()); configMessages.add(0, configMessage); } return configMessages; } AddContentActionHandler(ProcessorAction action); @Override List<ConfigMessage> init(Processor processor); @Override boolean process(Trace trace, Node node, Direction direction, Map<String, ?> headers,
            Object[] values);  }
@Test public void testNoName() { AddContentAction action = new AddContentAction(); action.setExpression(new LiteralExpression().setValue(TEST_VALUE_1)); AddContentActionHandler handler = new AddContentActionHandler(action); handler.init(new Processor()); }