use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class UpgradeServiceTest method getStack.
private Stack getStack() {
Stack stack = new Stack();
stack.setId(1L);
stack.setEnvironmentCrn("env-crn");
stack.setCloudPlatform("AWS");
stack.setPlatformVariant("AWS");
stack.setRegion("eu-central-1");
Blueprint blueprint = new Blueprint();
Cluster cluster = new Cluster();
cluster.setId(1L);
cluster.setBlueprint(blueprint);
stack.setCluster(cluster);
return stack;
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class ActiveCommandsValidatorTest method createStack.
private Stack createStack() {
Blueprint blueprint = new Blueprint();
blueprint.setBlueprintText("");
Cluster cluster = new Cluster();
cluster.setName("cluster");
cluster.setBlueprint(blueprint);
Stack stack = new Stack();
stack.setCluster(cluster);
return stack;
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class StructuredFlowEventFactoryTest method createStucturedFlowEvent.
@Test
public void createStucturedFlowEvent() {
Stack stack = TestUtil.stack();
Cluster cluster = TestUtil.cluster();
Blueprint blueprint = TestUtil.blueprint();
cluster.setBlueprint(blueprint);
stack.setCluster(cluster);
BlueprintDetails blueprintDetails = new BlueprintDetails();
blueprintDetails.setBlueprintName(bpName);
when(stackToStackDetailsConverter.convert(any())).thenReturn(null);
when(blueprintToBlueprintDetailsConverter.convert(blueprint)).thenReturn(blueprintDetails);
when(stackService.getByIdWithTransaction(1L)).thenReturn(stack);
StructuredFlowEvent result = baseLegacyStructuredFlowEventFactory.createStucturedFlowEvent(1L, new FlowDetails(), true);
assertNull(result.getException());
assertEquals(bpName, result.getBlueprintDetails().getBlueprintName());
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class StructuredSyncEventFactoryTest method createCDPStructuredSyncEvent.
@Test
public void createCDPStructuredSyncEvent() {
Stack stack = TestUtil.stack();
stack.setResourceCrn("crn");
Cluster cluster = TestUtil.cluster();
Blueprint blueprint = TestUtil.blueprint();
cluster.setBlueprint(blueprint);
stack.setCluster(cluster);
BlueprintDetails blueprintDetails = new BlueprintDetails();
blueprintDetails.setBlueprintName("testBpName");
when(stackToStackDetailsConverter.convert(any())).thenReturn(null);
when(blueprintToBlueprintDetailsConverter.convert(blueprint)).thenReturn(blueprintDetails);
when(stackService.getByIdWithTransaction(1L)).thenReturn(stack);
when(nodeConfig.getId()).thenReturn("cbid");
StructuredSyncEvent result = underTest.createStructuredSyncEvent(1L);
assertNull(result.getStack());
assertEquals(CloudbreakEventService.DATAHUB_RESOURCE_TYPE, result.getOperation().getResourceType());
assertEquals("crn", result.getOperation().getResourceCrn());
assertEquals("cbid", result.getOperation().getCloudbreakId());
assertEquals("testBpName", result.getBlueprintDetails().getBlueprintName());
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster in project cloudbreak by hortonworks.
the class StackStopRestrictionServiceTest method createStack.
private Stack createStack(String cloudProvider, Set<InstanceGroup> groups) {
Stack stack = new Stack();
stack.setCloudPlatform(cloudProvider);
stack.setId(42L);
stack.setInstanceGroups(groups);
Cluster cluster = new Cluster();
cluster.setId(42L);
Blueprint blueprint = new Blueprint();
blueprint.setBlueprintText("blueprint");
cluster.setBlueprint(blueprint);
stack.setCluster(cluster);
if (groups != null) {
groups.forEach(ig -> ig.setStack(stack));
}
return stack;
}
Aggregations