P2PSecretKeyModificationWorkflow extends CancellableWorkflow<P2PSecretKeyModificationWorkflow.P2PSecretKeyModificationPhase> { public P2PSecretKeyModificationPhase REPLACE_KEY() { operationTracker.addLog( "Modifying P2P secret key on peers" ); try { new P2PSecretKeyResetStep( environment, new P2PCredentials( environment.getId(), environment.getP2PHash(), p2pSecretKey, p2pSecretKeyTtlSeconds ), operationTracker ).execute(); saveEnvironment(); return P2PSecretKeyModificationPhase.FINALIZE; } catch ( Exception e ) { fail( e.getMessage(), e ); return null; } } P2PSecretKeyModificationWorkflow( final LocalEnvironment environment, final String p2pSecretKey,
                                             final long p2pSecretKeyTtlSeconds, final TrackerOperation operationTracker,
                                             final EnvironmentManagerImpl environmentManager ); P2PSecretKeyModificationPhase INIT(); P2PSecretKeyModificationPhase REPLACE_KEY(); void FINALIZE(); @Override void fail( final String message, final Throwable e ); @Override void onCancellation(); static final String P2P_CAUSE; }
@Test public void testREPLACE_KEY() throws Exception { workflow.REPLACE_KEY(); verify( environmentManager ).update( environment ); }