Search in sources :

Example 36 with ClouderaManagerProduct

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;
}
Also used : ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)

Example 37 with 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()));
}
Also used : Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 38 with ClouderaManagerProduct

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()));
}
Also used : Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 39 with ClouderaManagerProduct

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()));
}
Also used : Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 40 with ClouderaManagerProduct

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()));
}
Also used : Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Aggregations

ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)91 Test (org.junit.Test)34 Test (org.junit.jupiter.api.Test)23 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)23 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)20 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)14 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)10 Image (com.sequenceiq.cloudbreak.cloud.model.catalog.Image)9 ClusterComponent (com.sequenceiq.cloudbreak.domain.stack.cluster.ClusterComponent)9 ParcelInfo (com.sequenceiq.cloudbreak.service.upgrade.sync.common.ParcelInfo)9 HashSet (java.util.HashSet)8 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)8 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)7 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)7 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)6 IdBroker (com.sequenceiq.cloudbreak.domain.stack.cluster.IdBroker)6 ExtendedPollingResult (com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)6 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)6 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)6 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)5