EnvironmentCreationWorkflow extends CancellableWorkflow<EnvironmentCreationWorkflow.EnvironmentCreationPhase> { public void FINALIZE() { environment.setStatus( EnvironmentStatus.HEALTHY ); saveEnvironment(); operationTracker.addLogDone( "Environment is created" ); stop(); } EnvironmentCreationWorkflow( String defaultDomain, IdentityManager identityManager,
                                        EnvironmentManagerImpl environmentManager, PeerManager peerManager,
                                        SecurityManager securityManager, LocalEnvironment environment,
                                        Topology topology, String sshKey, TrackerOperation operationTracker ); EnvironmentCreationPhase INIT(); EnvironmentCreationPhase GENERATE_KEYS(); EnvironmentCreationPhase RESERVE_NET(); EnvironmentCreationPhase SETUP_P2P(); EnvironmentCreationPhase PREPARE_TEMPLATES(); EnvironmentCreationPhase CLONE_CONTAINERS(); EnvironmentCreationPhase CONFIGURE_HOSTS(); EnvironmentCreationPhase CONFIGURE_SSH(); EnvironmentCreationPhase SET_QUOTA(); void FINALIZE(); @Override void fail( final String message, final Throwable e ); @Override void onCancellation();  }
@Test public void testFINALIZE() throws Exception { workflow.FINALIZE(); verify( environmentManager, atLeastOnce() ).update( environment ); }