ReceiveAction extends MessageAction implements ReceivingAction { @Override public void execute(State state) throws WorkflowExecutionException { TlsContext tlsContext = state.getTlsContext(getConnectionAlias()); if (isExecuted()) { throw new WorkflowExecutionException("Action already executed!"); } LOGGER.debug("Receiving Messages..."); MessageActionResult result = receiveMessageHelper.receiveMessages(expectedMessages, tlsContext); records = new ArrayList<>(result.getRecordList()); messages = new ArrayList<>(result.getMessageList()); setExecuted(true); String expected = getReadableString(expectedMessages); LOGGER.debug("Receive Expected:" + expected); String received = getReadableString(messages); if (hasDefaultAlias()) { LOGGER.info("Received Messages: " + received); } else { LOGGER.info("Received Messages (" + getConnectionAlias() + "): " + received); } tlsContext.setEarlyCleanShutdown(earlyCleanShutdown == null ? false : earlyCleanShutdown); } ReceiveAction();  ReceiveAction(List<ProtocolMessage> expectedMessages);  ReceiveAction(ProtocolMessage... expectedMessages);  ReceiveAction(Set<ReceiveOption> receiveOptions, List<ProtocolMessage> messages);  ReceiveAction(Set<ReceiveOption> receiveOptions, ProtocolMessage... messages);  ReceiveAction(ReceiveOption receiveOption, List<ProtocolMessage> messages);  ReceiveAction(ReceiveOption receiveOption, ProtocolMessage... messages);  ReceiveAction(String connectionAlias);  ReceiveAction(String connectionAliasAlias, List<ProtocolMessage> messages);  ReceiveAction(String connectionAliasAlias, ProtocolMessage... messages); @Override void execute(State state); @Override String toString(); @Override String toCompactString(); @Override boolean executedAsPlanned(); List<ProtocolMessage> getExpectedMessages(); void setExpectedMessages(List<ProtocolMessage> expectedMessages); void setExpectedMessages(ProtocolMessage... expectedMessages); @Override void reset(); @Override List<ProtocolMessage> getReceivedMessages(); @Override List<AbstractRecord> getReceivedRecords(); @Override int hashCode(); @Override boolean equals(Object obj); @Override void normalize(); @Override void normalize(TlsAction defaultAction); @Override void filter(); @Override void filter(TlsAction defaultCon);  }
@Test public void testExecute() throws Exception { ((FakeTransportHandler) tlsContext.getTransportHandler()).setFetchableByte(new byte[] { 0x15, 0x03, 0x03, 0x00, 0x02, 0x02, 50 }); action.execute(state); assertTrue(action.executedAsPlanned()); assertTrue(action.isExecuted()); }