use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class ImageFilterParamsFactoryTest method createCMProduct.
private ClouderaManagerProduct createCMProduct(String name, String version) {
ClouderaManagerProduct clouderaManagerProduct = new ClouderaManagerProduct();
clouderaManagerProduct.setName(name);
clouderaManagerProduct.setVersion(version);
return clouderaManagerProduct;
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfNifi728PresentedAndUpScaleThenValidationShouldNotThrowBecauseTheBPVersionIsHigher.
@Test
public void testValidationIfNifi728PresentedAndUpScaleThenValidationShouldNotThrowBecauseTheBPVersionIsHigher() {
Blueprint blueprint = readBlueprint("input/nifi_7_2_8.bp");
String hostGroup = "master";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.2.8");
when(entitlementService.isEntitledFor(anyString(), any())).thenReturn(false);
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 testUpscaleValidationIfKafkaPresentedThenValidationShouldThrowBadRequest.
@Test
public void testUpscaleValidationIfKafkaPresentedThenValidationShouldThrowBadRequest() {
Blueprint blueprint = readBlueprint("input/kafka.bp");
String hostGroup = "broker";
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 testValidationIfNifiPresentedAndDownScaleAndEntitledForScalingThenValidationShouldReturnTrue.
@Test
public void testValidationIfNifiPresentedAndDownScaleAndEntitledForScalingThenValidationShouldReturnTrue() {
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 testDownscaleValidationIfKafkaPresentedThenShouldThrowBadRequest.
@Test
public void testDownscaleValidationIfKafkaPresentedThenShouldThrowBadRequest() {
Blueprint blueprint = readBlueprint("input/kafka.bp");
String hostGroup = "broker";
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, -1, List.of()));
}
Aggregations