SshKeyAdditionWorkflow extends CancellableWorkflow<SshKeyAdditionWorkflow.SshKeyAdditionPhase> { @Override public void onCancellation() { environment.setStatus( EnvironmentStatus.CANCELLED ); saveEnvironment(); operationTracker.addLogFailed( "Ssh key addition was cancelled" ); } SshKeyAdditionWorkflow( final LocalEnvironment environment, final String sshKey,
                                   final TrackerOperation operationTracker,
                                   final EnvironmentManagerImpl environmentManager ); SshKeyAdditionPhase INIT(); SshKeyAdditionPhase ADD_KEY(); void FINALIZE(); @Override void fail( final String message, final Throwable e ); @Override void onCancellation();  }
@Test public void testOnCancellation() throws Exception { workflow.onCancellation(); verify( trackerOperation ).addLogFailed( anyString() ); }