ChangeCipherSuiteAction 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.getSelectedCipherSuite(); tlsContext.setSelectedCipherSuite(newValue); tlsContext.getRecordLayer().updateDecryptionCipher(); tlsContext.getRecordLayer().updateEncryptionCipher(); LOGGER.info("Changed CipherSuite from " + (oldValue == null ? null : oldValue.name()) + " to " + newValue.name()); setExecuted(true); } ChangeCipherSuiteAction(CipherSuite newValue);  ChangeCipherSuiteAction(String alias, CipherSuite newValue);  ChangeCipherSuiteAction(); CipherSuite getNewValue(); void setNewValue(CipherSuite newValue); CipherSuite getOldValue(); @Override void execute(State state); @Override void reset(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean executedAsPlanned();  }
@Test public void testNoOld() { tlsContext.setSelectedCipherSuite(null); action.execute(state); }
@Test public void testExecute() { action.execute(state); assertEquals(tlsContext.getSelectedCipherSuite(), action.getNewValue()); assertTrue(action.isExecuted()); }