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);
}
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());
}
Aggregations