use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class StackStatusIntegrationTest method setUpStack.
private void setUpStack() {
underTest.setLocalId(STACK_ID.toString());
stack = new Stack();
stack.setId(STACK_ID);
Cluster cluster = new Cluster();
cluster.setVariant("AWS");
cluster.setClusterManagerIp("192.168.0.1");
cluster.setId(2L);
stack.setCluster(cluster);
stack.setResourceCrn("crn:stack");
User creator = new User();
creator.setUserId("user-id");
stack.setCreator(creator);
Workspace workspace = new Workspace();
workspace.setId(564L);
stack.setWorkspace(workspace);
when(stackService.get(STACK_ID)).thenReturn(stack);
when(instanceMetaDataService.findNotTerminatedAndNotZombieForStack(STACK_ID)).thenReturn(runningInstances);
when(instanceMetaDataService.findNotTerminatedAndNotZombieForStackWithoutInstanceGroups(STACK_ID)).thenReturn(runningInstances);
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class ClusterManagerUpgradeServiceTest method testUpgradeClusterManagerWithoutStartServices.
@Test
public void testUpgradeClusterManagerWithoutStartServices() throws CloudbreakOrchestratorException, CloudbreakException {
Cluster cluster = stack.getCluster();
underTest.upgradeClusterManager(STACK_ID, false);
verify(gatewayConfigService, times(1)).getGatewayConfig(stack, stack.getPrimaryGatewayInstance(), cluster.getGateway() != null);
verify(clusterComponentConfigProvider, times(1)).getClouderaManagerRepoDetails(cluster.getId());
verify(hostOrchestrator, times(1)).upgradeClusterManager(any(), any(), any(), any(), any());
verify(clusterApi).stopCluster(true);
verify(clusterHostServiceRunner, times(1)).decoratePillarWithClouderaManagerRepo(any(), any(), any());
verify(clusterHostServiceRunner, times(1)).createPillarWithClouderaManagerSettings(any(), any(), any());
verify(clusterApi, never()).startCluster();
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class ClusterManagerUpgradeServiceTest method testUpgradeClusterManagerShouldNotAddCsdToPillarWhenTheClusterTypeIsDataLake.
@Test
public void testUpgradeClusterManagerShouldNotAddCsdToPillarWhenTheClusterTypeIsDataLake() throws CloudbreakOrchestratorException, CloudbreakException {
Cluster cluster = stack.getCluster();
stack.setType(StackType.DATALAKE);
underTest.upgradeClusterManager(STACK_ID, true);
verify(gatewayConfigService, times(1)).getGatewayConfig(stack, stack.getPrimaryGatewayInstance(), cluster.getGateway() != null);
verify(clusterComponentConfigProvider, times(1)).getClouderaManagerRepoDetails(cluster.getId());
verify(hostOrchestrator, times(1)).upgradeClusterManager(any(), any(), any(), any(), any());
verify(clusterApi).stopCluster(true);
verify(clusterHostServiceRunner, times(1)).decoratePillarWithClouderaManagerRepo(any(), any(), any());
verify(clusterHostServiceRunner, times(1)).createPillarWithClouderaManagerSettings(any(), any(), any());
verify(clusterApi).startCluster();
verify(csdParcelDecorator, times(1)).decoratePillarWithCsdParcels(any(), any());
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class ClusterManagerUpgradeServiceTest method setUp.
@Before
public void setUp() {
stack = TestUtil.stack(Status.AVAILABLE, TestUtil.awsCredential());
Cluster cluster = TestUtil.cluster();
stack.setCluster(cluster);
when(stackService.getByIdWithListsInTransaction(STACK_ID)).thenReturn(stack);
when(clusterApiConnectors.getConnector(stack)).thenReturn(clusterApi);
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class ClusterManagerUpgradeServiceTest method testUpgradeClusterManagerShouldAddCsdToPillarWhenTheClusterTypeIsWorkload.
@Test
public void testUpgradeClusterManagerShouldAddCsdToPillarWhenTheClusterTypeIsWorkload() throws CloudbreakOrchestratorException, CloudbreakException {
Cluster cluster = stack.getCluster();
stack.setType(StackType.WORKLOAD);
underTest.upgradeClusterManager(STACK_ID, true);
verify(gatewayConfigService, times(1)).getGatewayConfig(stack, stack.getPrimaryGatewayInstance(), cluster.getGateway() != null);
verify(clusterComponentConfigProvider, times(1)).getClouderaManagerRepoDetails(cluster.getId());
verify(hostOrchestrator, times(1)).upgradeClusterManager(any(), any(), any(), any(), any());
verify(clusterApi).stopCluster(true);
verify(clusterHostServiceRunner, times(1)).decoratePillarWithClouderaManagerRepo(any(), any(), any());
verify(clusterHostServiceRunner, times(1)).createPillarWithClouderaManagerSettings(any(), any(), any());
verify(clusterApi).startCluster();
verify(csdParcelDecorator, times(1)).decoratePillarWithCsdParcels(any(), any());
}
Aggregations