Search in sources :

Example 21 with BlueprintTextProcessor

use of com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor in project cloudbreak by hortonworks.

the class KnoxServiceConfigProviderTest method testGetServiceConfigsWhenCMAtLeast741AndCDHVersion7291ShouldIncludeDBProperties.

@ParameterizedTest(name = "{index}: check knox properties cm version {0} and cdh version {1} will produce {2} property")
@MethodSource("cmCdhCombinations")
public void testGetServiceConfigsWhenCMAtLeast741AndCDHVersion7291ShouldIncludeDBProperties(String cdhVersion, String cmVersion, int numberOfProperties) {
    CmTemplateProcessor templateProcessor = mock(CmTemplateProcessor.class);
    BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
    BlueprintView blueprintView = new BlueprintView("text", cdhVersion, "CDH", blueprintTextProcessor);
    RDSConfig rdsConfig = new RDSConfig();
    rdsConfig.setConnectionPassword("pw");
    rdsConfig.setConnectionUserName("usr");
    rdsConfig.setType(DatabaseType.KNOX_GATEWAY.name());
    rdsConfig.setConnectionURL("jdbc:postgresql://somehost.com:5432/dbName");
    TemplatePreparationObject source = TemplatePreparationObject.Builder.builder().withBlueprintView(blueprintView).withRdsSslCertificateFilePath("file://path").withRdsConfigs(Set.of(rdsConfig)).withProductDetails(new ClouderaManagerRepo().withVersion(cmVersion), List.of(new ClouderaManagerProduct().withVersion(cdhVersion).withName("CDH"))).build();
    when(blueprintTextProcessor.getStackVersion()).thenReturn(cdhVersion);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(templateProcessor, source);
    Assert.assertTrue(serviceConfigs.size() == numberOfProperties);
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ClouderaManagerRepo(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo) BlueprintTextProcessor(com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 22 with BlueprintTextProcessor

use of com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor in project cloudbreak by hortonworks.

the class RangerRazBaseConfigProviderTest method getServiceTypesConfigWheAGCPAnd7210ShouldNOTAddProperty.

@Test
public void getServiceTypesConfigWheAGCPAnd7210ShouldNOTAddProperty() {
    BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
    when(blueprintTextProcessor.getVersion()).thenReturn(Optional.of("7.2.10"));
    TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withStackType(StackType.WORKLOAD).withBlueprintView(new BlueprintView("", "7.2.10", "CDH", blueprintTextProcessor)).withCloudPlatform(CloudPlatform.GCP).withGeneralClusterConfigs(new GeneralClusterConfigs()).withDataLakeView(new DatalakeView(false)).build();
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs("", preparationObject);
    assertEquals(0, roleConfigs.size());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) BlueprintTextProcessor(com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) DatalakeView(com.sequenceiq.cloudbreak.template.views.DatalakeView) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test)

Aggregations

BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)22 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)13 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)12 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)11 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)7 Test (org.junit.jupiter.api.Test)7 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)6 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)6 DatalakeView (com.sequenceiq.cloudbreak.template.views.DatalakeView)6 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)5 IdBroker (com.sequenceiq.cloudbreak.domain.stack.cluster.IdBroker)5 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)5 HashMap (java.util.HashMap)5 Test (org.junit.Test)5 HashSet (java.util.HashSet)4 GatewayTopology (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.GatewayTopology)3 AutoscaleRecommendation (com.sequenceiq.cloudbreak.cloud.model.AutoscaleRecommendation)2 ResizeRecommendation (com.sequenceiq.cloudbreak.cloud.model.ResizeRecommendation)2 ExposedServices (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.ExposedServices)2 HostGroup (com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup)2