use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testValidationIfKafka7212PresentedAndDownScaleThenValidationShouldNOTThrowError.
@Test
public void testValidationIfKafka7212PresentedAndDownScaleThenValidationShouldNOTThrowError() {
Blueprint blueprint = readBlueprint("input/kafka-cc_7_2_12.bp");
String hostGroup = "broker";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.2.12");
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 testDownscaleValidationIfKafkaPresentedAndEntitledForScalingThenValidationShouldReturnTrue.
@Test
public void testDownscaleValidationIfKafkaPresentedAndEntitledForScalingThenValidationShouldReturnTrue() {
Blueprint blueprint = readBlueprint("input/kafka.bp");
String hostGroup = "broker";
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, -1, List.of()));
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmTemplateValidatorTest method testUpscaleValidationIfKafkaPresentedAndEntitledForScalingThenValidationShouldReturnTrue.
@Test
public void testUpscaleValidationIfKafkaPresentedAndEntitledForScalingThenValidationShouldReturnTrue() {
Blueprint blueprint = readBlueprint("input/kafka.bp");
String hostGroup = "broker";
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 testValidationIfKafka7212WithoutCruiseControlPresentedAndDownScaleThenValidationShouldThrowError.
@Test
public void testValidationIfKafka7212WithoutCruiseControlPresentedAndDownScaleThenValidationShouldThrowError() {
Blueprint blueprint = readBlueprint("input/kafka-no-cc_7_2_12.bp");
String hostGroup = "broker";
ClouderaManagerProduct clouderaManagerRepo = new ClouderaManagerProduct();
clouderaManagerRepo.setVersion("7.2.12");
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 KnoxGatewayConfigProviderTest method roleConfigsWithoutGateway.
@Test
public void roleConfigsWithoutGateway() {
GeneralClusterConfigs gcc = new GeneralClusterConfigs();
gcc.setPassword("secret");
gcc.setAccountId(Optional.of("1234"));
IdBroker idBroker = new IdBroker();
idBroker.setMasterSecret("supersecret");
BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
BlueprintView blueprintView = new BlueprintView("text", "7.2.11", "CDH", blueprintTextProcessor);
TemplatePreparationObject source = Builder.builder().withGeneralClusterConfigs(gcc).withVirtualGroupView(new VirtualGroupRequest(TestConstants.CRN, "")).withIdBroker(idBroker).withBlueprintView(blueprintView).withProductDetails(new ClouderaManagerRepo().withVersion("7.4.2"), List.of(new ClouderaManagerProduct().withVersion("7.2.10").withName("CDH"))).build();
when(virtualGroupService.createOrGetVirtualGroup(source.getVirtualGroupRequest(), UmsVirtualGroupRight.KNOX_ADMIN)).thenReturn("");
assertEquals(List.of(config("idbroker_master_secret", "supersecret"), config("idbroker_gateway_knox_admin_groups", ""), config("idbroker_gateway_signing_keystore_name", "signing.jks"), config("idbroker_gateway_signing_keystore_type", "JKS"), config("idbroker_gateway_signing_key_alias", "signing-identity")), underTest.getRoleConfigs(KnoxRoles.IDBROKER, source));
assertEquals(List.of(config("gateway_master_secret", gcc.getPassword()), config("gateway_default_topology_name", "cdp-proxy"), config("gateway_knox_admin_groups", ""), config("gateway_auto_discovery_enabled", "false"), config("gateway_service_tokenstate_impl", "org.apache.knox.gateway.services.token.impl.JDBCTokenStateService")), underTest.getRoleConfigs(KnoxRoles.KNOX_GATEWAY, source));
assertEquals(List.of(), underTest.getRoleConfigs("NAMENODE", source));
}
Aggregations