SshKeyAdditionWorkflow extends CancellableWorkflow<SshKeyAdditionWorkflow.SshKeyAdditionPhase> { @Override public void fail( final String message, final Throwable e ) { environment.setStatus( EnvironmentStatus.UNHEALTHY ); saveEnvironment(); operationTracker.addLogFailed( message ); super.fail( message, e ); } 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 testFail() throws Exception { Throwable throwable = mock( Throwable.class ); workflow.fail( "", throwable ); verify( trackerOperation ).addLogFailed( anyString() ); }