EnvironmentDestructionWorkflow extends CancellableWorkflow<EnvironmentDestructionWorkflow.EnvironmentDestructionPhase> { @Override public void fail( final String message, final Throwable e ) { environment.setStatus( EnvironmentStatus.UNHEALTHY ); saveEnvironment(); operationTracker.addLogFailed( message ); super.fail( message, e ); } EnvironmentDestructionWorkflow( final EnvironmentManagerImpl environmentManager,
                                           final LocalEnvironment environment, final TrackerOperation operationTracker ); EnvironmentDestructionPhase INIT(); EnvironmentDestructionPhase CLEANUP_ENVIRONMENT(); void FINALIZE(); @Override void fail( final String message, final Throwable e ); @Override void onCancellation();  }
@Test public void testFail() throws Exception { workflow.fail( "", null ); verify( trackerOperation, atLeastOnce() ).addLogFailed( anyString() ); }