use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfNifi727PresentedAndUpScaleThenValidationShouldThrowBecauseTheBPVersionIsLower.
@Test
public void testValidationIfNifi727PresentedAndUpScaleThenValidationShouldThrowBecauseTheBPVersionIsLower() {
Blueprint blueprint = readBlueprint("input/nifi_7_2_7.bp");
String hostGroup = "master";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.2.7");
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 testValidationIfKafkaUpgradedTo7212PresentedAndUpScaleThenValidationShouldNOTThrowError.
@Test
public void testValidationIfKafkaUpgradedTo7212PresentedAndUpScaleThenValidationShouldNOTThrowError() {
Blueprint blueprint = readBlueprint("input/kafka.bp");
String hostGroup = "broker";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.2.12");
when(entitlementService.isEntitledFor(anyString(), any())).thenReturn(false);
assertDoesNotThrow(() -> 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 testValidationIfNifiPresentedAndUpScaleAndEntitledForScalingThenValidationShouldReturnTrue.
@Test
public void testValidationIfNifiPresentedAndUpScaleAndEntitledForScalingThenValidationShouldReturnTrue() {
Blueprint blueprint = readBlueprint("input/nifi.bp");
String hostGroup = "master";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.0.0");
when(entitlementService.isEntitledFor(anyString(), any())).thenReturn(true);
assertDoesNotThrow(() -> 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 testValidationIfNodeManagerCountWillBeHigherThanZeroInTheSameGroup.
@Test
public void testValidationIfNodeManagerCountWillBeHigherThanZeroInTheSameGroup() {
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());
subject.validateHostGroupScalingRequest(ACCOUNT_ID, blueprint, Optional.of(clouderaManagerRepo), hostGroup, -2, Set.of(compute, worker));
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfNifi726PresentedAndUpScaleThenValidationShouldNotThrowBecauseTheBPVersionIsHigher.
@Test
public void testValidationIfNifi726PresentedAndUpScaleThenValidationShouldNotThrowBecauseTheBPVersionIsHigher() {
Blueprint blueprint = readBlueprint("input/nifi_7_2_6.bp");
String hostGroup = "master";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.2.6");
when(entitlementService.isEntitledFor(anyString(), any())).thenReturn(false);
assertThrows(BadRequestException.class, () -> subject.validateHostGroupScalingRequest(ACCOUNT_ID, blueprint, Optional.of(clouderaManagerRepo), hostGroup, 2, List.of()));
}
Aggregations