FindReceivedProtocolMessageAction extends ConnectionBoundAction { @Override public void execute(State state) throws WorkflowExecutionException { TlsContext ctx = state.getTlsContext(getConnectionAlias()); found = WorkflowTraceUtil.didReceiveMessage(protocolMessageType, state.getWorkflowTrace()); if (found) { LOGGER.info("Found " + protocolMessageType.name() + " (" + protocolMessageType.getValue() + ")"); } setExecuted(Boolean.TRUE); } FindReceivedProtocolMessageAction();  FindReceivedProtocolMessageAction(ProtocolMessageType protocolMessageType);  FindReceivedProtocolMessageAction(String alias, ProtocolMessageType protocolMessageType); @Override void execute(State state); ProtocolMessageType getProtocolMessageType(); void setProtocolMessageType(ProtocolMessageType protocolMessageType); Boolean isFound(); @Override boolean executedAsPlanned(); @Override void reset();  }
@Test @Category(IntegrationTests.class) public void testExecute() throws Exception { Config config = Config.createConfig(); config.getDefaultClientConnection().setPort(SERVER_PORT); WorkflowConfigurationFactory factory = new WorkflowConfigurationFactory(config); WorkflowTrace trace = factory.createWorkflowTrace(WorkflowTraceType.HELLO, RunningModeType.CLIENT); FindReceivedProtocolMessageAction action_find_handshake = new FindReceivedProtocolMessageAction( ProtocolMessageType.HANDSHAKE); FindReceivedProtocolMessageAction action_find_app_data = new FindReceivedProtocolMessageAction( ProtocolMessageType.APPLICATION_DATA); trace.addTlsAction(action_find_handshake); trace.addTlsAction(action_find_app_data); State state = new State(config, trace); try { TimeHelper.setProvider(new FixedTimeProvider(0)); KeyPair k = KeyStoreGenerator.createRSAKeyPair(1024, random); KeyStore ks = KeyStoreGenerator.createKeyStore(k, random); BasicTlsServer tlsServer = new BasicTlsServer(ks, KeyStoreGenerator.PASSWORD, "TLS", SERVER_PORT); LOGGER.info("Starting test server"); new Thread(tlsServer).start(); while (!tlsServer.isInitialized()) ; WorkflowExecutor executor = new DefaultWorkflowExecutor(state); executor.executeWorkflow(); LOGGER.info("Killing server..."); tlsServer.shutdown(); LOGGER.info("Done."); } catch (NoSuchAlgorithmException | CertificateException | IOException | InvalidKeyException | KeyStoreException | NoSuchProviderException | SignatureException | UnrecoverableKeyException | KeyManagementException ex) { fail(); } assertTrue(action_find_handshake.isFound()); assertFalse(action_find_app_data.isFound()); }