EnvironmentModifyWorkflow extends CancellableWorkflow<EnvironmentModifyWorkflow.EnvironmentModificationPhase> { public EnvironmentModificationPhase INIT() { hasQuotaModification = !CollectionUtil.isMapEmpty( changedContainers ); hasContainerDestruction = !CollectionUtil.isCollectionEmpty( removedContainers ); hasContainerCreation = topology != null && !CollectionUtil.isCollectionEmpty( topology.getAllPeers() ); operationTracker.addLog( "Initializing environment modification" ); environment.setStatus( EnvironmentStatus.UNDER_MODIFICATION ); saveEnvironment(); return hasContainerCreation ? EnvironmentModificationPhase.GENERATE_KEYS : ( hasQuotaModification ? EnvironmentModificationPhase.MODIFY_QUOTA : EnvironmentModificationPhase.DESTROY_CONTAINERS ); } EnvironmentModifyWorkflow( String defaultDomain, IdentityManager identityManager, PeerManager peerManager,
                                      SecurityManager securityManager, LocalEnvironment environment, Topology topology,
                                      Set<String> removedContainers, Map<String, ContainerQuota> changedContainers,
                                      TrackerOperation operationTracker, EnvironmentManagerImpl environmentManager ); EnvironmentModificationPhase INIT(); EnvironmentModificationPhase GENERATE_KEYS(); EnvironmentModificationPhase RESERVE_NET(); EnvironmentModificationPhase SETUP_P2P(); EnvironmentModificationPhase PREPARE_TEMPLATES(); EnvironmentModificationPhase CLONE_CONTAINERS(); EnvironmentModificationPhase CONFIGURE_HOSTS(); EnvironmentModificationPhase CONFIGURE_SSH(); EnvironmentModificationPhase SET_QUOTA(); EnvironmentModificationPhase MODIFY_QUOTA(); EnvironmentModificationPhase DESTROY_CONTAINERS(); EnvironmentModificationPhase REMOVE_HOSTNAMES(); void FINALIZE(); @Override void fail( final String message, final Throwable e ); @Override void onCancellation();  }
@Test public void testINIT() throws Exception { workflow.INIT(); verify( environmentManager ).update( environment ); }