HostnameModificationWorkflow extends CancellableWorkflow<HostnameModificationWorkflow.HostnameModificationPhase> { public HostnameModificationPhase UPDATE_ETC_HOSTS_FILE() { operationTracker.addLog( "Modifying hosts files" ); try { new UpdateEtcHostsStep( environment, oldHostname, newHostname, operationTracker ).execute(); saveEnvironment(); return HostnameModificationPhase.UPDATE_AUTHORIZED_KEYS_FILE; } catch ( Exception e ) { fail( e.getMessage(), e ); return null; } } 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 testUPDATE_ETC_HOSTS_FILE() throws Exception { workflow.UPDATE_ETC_HOSTS_FILE(); verify( environmentManager ).update( environment ); }