HostnameModificationWorkflow extends CancellableWorkflow<HostnameModificationWorkflow.HostnameModificationPhase> { @Override public void onCancellation() { environment.setStatus( EnvironmentStatus.CANCELLED ); saveEnvironment(); operationTracker.addLogFailed( "Hostname modification was cancelled" ); } HostnameModificationWorkflow( final LocalEnvironment environment, final ContainerId containerId,
                                         final String newHostname, final TrackerOperation operationTracker,
                                         final EnvironmentManagerImpl environmentManager, final String oldHostname );  HostnameModificationWorkflow( final LocalEnvironment environment, final ContainerId containerId,
                                         final String newHostname, final TrackerOperation operationTracker,
                                         final EnvironmentManagerImpl environmentManager ); HostnameModificationPhase INIT(); HostnameModificationPhase CHANGE_HOSTNAME(); HostnameModificationPhase UPDATE_ETC_HOSTS_FILE(); HostnameModificationPhase UPDATE_AUTHORIZED_KEYS_FILE(); 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() ); }