EnvironmentDestructionWorkflow extends CancellableWorkflow<EnvironmentDestructionWorkflow.EnvironmentDestructionPhase> { public EnvironmentDestructionPhase CLEANUP_ENVIRONMENT() { operationTracker.addLog( "Destroying environment" ); try { new CleanupEnvironmentStep( environment, operationTracker ).execute(); saveEnvironment(); return EnvironmentDestructionPhase.FINALIZE; } catch ( Exception e ) { fail( e.getMessage(), e ); return null; } } 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 testCLEANUP_ENVIRONMENT() throws Exception { workflow.CLEANUP_ENVIRONMENT(); verify( environmentManager, atLeastOnce() ).update( environment ); }