SendAction extends MessageAction implements SendingAction { @Override public void execute(State state) throws WorkflowExecutionException { TlsContext tlsContext = state.getTlsContext(connectionAlias); if (isExecuted()) { throw new WorkflowExecutionException("Action already executed!"); } String sending = getReadableString(messages); if (hasDefaultAlias()) { LOGGER.info("Sending messages: " + sending); } else { LOGGER.info("Sending messages (" + connectionAlias + "): " + sending); } try { MessageActionResult result = sendMessageHelper.sendMessages(messages, records, tlsContext); messages = new ArrayList<>(result.getMessageList()); records = new ArrayList<>(result.getRecordList()); setExecuted(true); } catch (IOException E) { tlsContext.setReceivedTransportHandlerException(true); LOGGER.debug(E); setExecuted(false); } } SendAction();  SendAction(List<ProtocolMessage> messages);  SendAction(ProtocolMessage... messages);  SendAction(String connectionAlias);  SendAction(String connectionAlias, List<ProtocolMessage> messages);  SendAction(String connectionAlias, ProtocolMessage... messages); @Override void execute(State state); @Override String toString(); @Override String toCompactString(); @Override boolean executedAsPlanned(); @Override void setRecords(List<AbstractRecord> records); @Override void reset(); @Override List<ProtocolMessage> getSendMessages(); @Override List<AbstractRecord> getSendRecords(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testExecute() { action.execute(state); action.executedAsPlanned(); assertTrue(action.isExecuted()); }