EnvironmentDestructionWorkflow extends CancellableWorkflow<EnvironmentDestructionWorkflow.EnvironmentDestructionPhase> { @Override public void onCancellation() { environment.setStatus( EnvironmentStatus.CANCELLED ); saveEnvironment(); operationTracker.addLogFailed( "Environment destruction was cancelled" ); } 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 testOnCancellation() throws Exception { workflow.onCancellation(); verify( trackerOperation, atLeastOnce() ).addLogFailed( anyString() ); }