ChangeProtocolVersionAction extends ConnectionBoundAction { @Override public void execute(State state) throws WorkflowExecutionException { TlsContext tlsContext = state.getTlsContext(getConnectionAlias()); if (isExecuted()) { throw new WorkflowExecutionException("Action already executed!"); } oldValue = tlsContext.getSelectedProtocolVersion(); tlsContext.setSelectedProtocolVersion(newValue); LOGGER.info("Changed ProtocolVersion from " + oldValue == null ? oldValue.name() : null + " to " + newValue.name()); setExecuted(true); } ChangeProtocolVersionAction(ProtocolVersion newValue);  ChangeProtocolVersionAction(); void setNewValue(ProtocolVersion newValue); ProtocolVersion getNewValue(); ProtocolVersion getOldValue(); @Override void execute(State state); @Override void reset(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean executedAsPlanned();  }
@Test public void testExecute() { tlsContext.setSelectedProtocolVersion(ProtocolVersion.TLS12); action.execute(state); assertEquals(action.getOldValue(), ProtocolVersion.TLS12); assertEquals(action.getNewValue(), ProtocolVersion.SSL2); assertEquals(tlsContext.getSelectedProtocolVersion(), ProtocolVersion.SSL2); assertTrue(action.isExecuted()); }