P2PSecretKeyModificationWorkflow extends CancellableWorkflow<P2PSecretKeyModificationWorkflow.P2PSecretKeyModificationPhase> { @Override public void onCancellation() { environment.setStatus( EnvironmentStatus.CANCELLED ); saveEnvironment(); operationTracker.addLogFailed( "P2P secret key modification was cancelled" ); } 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 testOnCancellation() throws Exception { workflow.onCancellation(); verify( trackerOperation ).addLogFailed( anyString() ); }