@Test public void testExecute() { tlsContext.setMasterSecret(new byte[] { 3 }); action.execute(state); assertArrayEquals(action.getOldValue(), new byte[] { 3 }); assertArrayEquals(action.getNewValue(), new byte[] { 0, 1 }); assertArrayEquals(tlsContext.getMasterSecret(), new byte[] { 0, 1 }); assertTrue(action.isExecuted()); }
@Override public void execute(State state) throws WorkflowExecutionException { TlsContext tlsContext = state.getTlsContext(getConnectionAlias()); if (isExecuted()) { throw new WorkflowExecutionException("Action already executed!"); } oldValue = tlsContext.getMasterSecret(); tlsContext.setMasterSecret(newValue); LOGGER.info("Changed MasterSecret from " + ArrayConverter.bytesToHexString(oldValue) + " to " + ArrayConverter.bytesToHexString(newValue)); setExecuted(true); }
ChangeMasterSecretAction 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.getMasterSecret(); tlsContext.setMasterSecret(newValue); LOGGER.info("Changed MasterSecret from " + ArrayConverter.bytesToHexString(oldValue) + " to " + ArrayConverter.bytesToHexString(newValue)); setExecuted(true); } }
ChangeMasterSecretAction 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.getMasterSecret(); tlsContext.setMasterSecret(newValue); LOGGER.info("Changed MasterSecret from " + ArrayConverter.bytesToHexString(oldValue) + " to " + ArrayConverter.bytesToHexString(newValue)); setExecuted(true); } ChangeMasterSecretAction(byte[] newValue);  ChangeMasterSecretAction(); }
ChangeMasterSecretAction 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.getMasterSecret(); tlsContext.setMasterSecret(newValue); LOGGER.info("Changed MasterSecret from " + ArrayConverter.bytesToHexString(oldValue) + " to " + ArrayConverter.bytesToHexString(newValue)); setExecuted(true); } ChangeMasterSecretAction(byte[] newValue);  ChangeMasterSecretAction(); void setNewValue(byte[] newValue); byte[] getNewValue(); byte[] getOldValue(); @Override void execute(State state); @Override void reset(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean executedAsPlanned(); }
ChangeMasterSecretAction 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.getMasterSecret(); tlsContext.setMasterSecret(newValue); LOGGER.info("Changed MasterSecret from " + ArrayConverter.bytesToHexString(oldValue) + " to " + ArrayConverter.bytesToHexString(newValue)); setExecuted(true); } ChangeMasterSecretAction(byte[] newValue);  ChangeMasterSecretAction(); void setNewValue(byte[] newValue); byte[] getNewValue(); byte[] getOldValue(); @Override void execute(State state); @Override void reset(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean executedAsPlanned();  }