use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfNifiPresentedAndDownScaleThenValidationShouldThrowException.
@Test
public void testValidationIfNifiPresentedAndDownScaleThenValidationShouldThrowException() {
Blueprint blueprint = readBlueprint("input/nifi.bp");
String hostGroup = "master";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.0.0");
when(entitlementService.isEntitledFor(anyString(), any())).thenReturn(false);
assertThrows(BadRequestException.class, () -> subject.validateHostGroupScalingRequest(ACCOUNT_ID, blueprint, Optional.of(clouderaManagerRepo), hostGroup, -2, List.of()));
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfNodeManagerCountWillBeZero.
@Test
public void testValidationIfNodeManagerCountWillBeZero() {
Blueprint blueprint = readBlueprint("input/cdp-data-mart.bp");
String hostGroup = "compute";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.0.0");
InstanceGroup compute = new InstanceGroup();
compute.setGroupName("compute");
compute.setInstanceMetaData(Set.of(new InstanceMetaData(), new InstanceMetaData(), new InstanceMetaData()));
InstanceGroup worker = new InstanceGroup();
worker.setGroupName("worker");
worker.setInstanceMetaData(Set.of());
BadRequestException badRequestException = assertThrows(BadRequestException.class, () -> subject.validateHostGroupScalingRequest(ACCOUNT_ID, blueprint, Optional.of(clouderaManagerRepo), hostGroup, -3, List.of(compute, worker)));
assertEquals("Scaling adjustment is not allowed. NODEMANAGER role must be present on 1 host(s) but after the scaling operation 0 host(s) " + "would have this role. Based on the template this role is present on the compute, worker host group(s).", badRequestException.getMessage());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfNifiPresentedAndUpScaleThenValidationShouldThrowException.
@Test
public void testValidationIfNifiPresentedAndUpScaleThenValidationShouldThrowException() {
Blueprint blueprint = readBlueprint("input/nifi.bp");
String hostGroup = "master";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.0.0");
when(entitlementService.isEntitledFor(anyString(), any())).thenReturn(false);
assertThrows(BadRequestException.class, () -> subject.validateHostGroupScalingRequest(ACCOUNT_ID, blueprint, Optional.of(clouderaManagerRepo), hostGroup, 2, List.of()));
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfKafkaUpgradedTo7211PresentedAndUpScaleThenValidationShouldThrowError.
@Test
public void testValidationIfKafkaUpgradedTo7211PresentedAndUpScaleThenValidationShouldThrowError() {
Blueprint blueprint = readBlueprint("input/kafka.bp");
String hostGroup = "broker";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.2.11");
when(entitlementService.isEntitledFor(anyString(), any())).thenReturn(false);
assertThrows(BadRequestException.class, () -> subject.validateHostGroupScalingRequest(ACCOUNT_ID, blueprint, Optional.of(clouderaManagerRepo), hostGroup, +1, List.of()));
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfNodeManagerCountWillBeHigherThanZeroInOtherGroup.
@Test
public void testValidationIfNodeManagerCountWillBeHigherThanZeroInOtherGroup() {
Blueprint blueprint = readBlueprint("input/cdp-data-mart.bp");
String hostGroup = "compute";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.0.0");
InstanceGroup compute = new InstanceGroup();
compute.setGroupName("compute");
compute.setInstanceMetaData(Set.of(new InstanceMetaData(), new InstanceMetaData(), new InstanceMetaData()));
InstanceGroup worker = new InstanceGroup();
worker.setGroupName("worker");
worker.setInstanceMetaData(Set.of(new InstanceMetaData()));
subject.validateHostGroupScalingRequest(ACCOUNT_ID, blueprint, Optional.of(clouderaManagerRepo), hostGroup, -2, Set.of(compute, worker));
}
Aggregations