use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class RangerRazBaseConfigProviderTest method getServiceTypesConfigWheAAWSAnd729ShouldNOTAddProperty.
@Test
public void getServiceTypesConfigWheAAWSAnd729ShouldNOTAddProperty() {
BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
when(blueprintTextProcessor.getVersion()).thenReturn(Optional.of("7.2.9"));
TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withStackType(StackType.WORKLOAD).withBlueprintView(new BlueprintView("", "7.2.9", "CDH", blueprintTextProcessor)).withCloudPlatform(CloudPlatform.AWS).withGeneralClusterConfigs(new GeneralClusterConfigs()).withDataLakeView(new DatalakeView(false)).build();
List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs("", preparationObject);
assertEquals(0, roleConfigs.size());
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class SchemaRegistryJarStorageConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(Integer... instanceCountsForSchemaRegistryHostGroups) {
List<HostgroupView> srHostGroups = Arrays.stream(instanceCountsForSchemaRegistryHostGroups).map(nodeCnt -> new HostgroupView(null, 0, InstanceGroupType.CORE, nodeCnt)).collect(toList());
TemplatePreparationObject tpo = mock(TemplatePreparationObject.class, withSettings().lenient());
when(tpo.getHostGroupsWithComponent(SCHEMA_REGISTRY_SERVER)).thenAnswer(__ -> srHostGroups.stream());
when(tpo.getBlueprintView()).thenReturn(blueprintView);
return tpo;
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class SchemaRegistryJarStorageConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(HostgroupView hostGroup) {
String inputJson = FileReaderUtils.readFileFromClasspathQuietly("input/kafka.bp");
TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withHostgroupViews(Set.of(hostGroup)).withBlueprintView(new BlueprintView(inputJson, "CDP", "1.0", new CmTemplateProcessor(inputJson))).build();
return preparationObject;
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class HueConfigProviderTest method getProxyHostsWhenLoadBalancerConfigured.
@Test
public void getProxyHostsWhenLoadBalancerConfigured() {
BlueprintView blueprintView = getMockBlueprintView("7.0.1", "7.0.1");
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setType(HUE);
rdsConfig.setConnectionURL(String.format("jdbc:%s://%s:%s/%s", DB_PROVIDER, HOST, PORT, DB_NAME));
rdsConfig.setConnectionUserName(USER_NAME);
rdsConfig.setConnectionPassword(PASSWORD);
String expectedExternalFQDN = "myaddress.cloudera.site";
String expectedLBFQDN = "loadbalancer-gateway.cloudera.site";
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setExternalFQDN(expectedExternalFQDN);
generalClusterConfigs.setKnoxUserFacingCertConfigured(true);
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.empty());
generalClusterConfigs.setLoadBalancerGatewayFqdn(Optional.of(expectedLBFQDN));
TemplatePreparationObject tpo = new Builder().withGeneralClusterConfigs(generalClusterConfigs).withGateway(new Gateway(), "", new HashSet<>()).withBlueprintView(blueprintView).withRdsConfigs(Set.of(rdsConfig)).build();
List<ApiClusterTemplateVariable> result = underTest.getServiceConfigVariables(tpo);
Map<String, String> paramToVariable = result.stream().collect(Collectors.toMap(ApiClusterTemplateVariable::getName, ApiClusterTemplateVariable::getValue));
String proxyHostsExpected1 = String.join(",", expectedExternalFQDN, expectedLBFQDN);
String proxyHostsExpected2 = String.join(",", expectedLBFQDN, expectedExternalFQDN);
String expectedSafetyValveValue1 = "[desktop]\n[[knox]]\nknox_proxyhosts=".concat(proxyHostsExpected1);
String expectedSafetyValveValue2 = "[desktop]\n[[knox]]\nknox_proxyhosts=".concat(proxyHostsExpected2);
assertThat(paramToVariable).containsAnyOf(new SimpleEntry<>("hue-hue_service_safety_valve", expectedSafetyValveValue1), new SimpleEntry<>("hue-hue_service_safety_valve", expectedSafetyValveValue2));
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class HueConfigProviderTest method getServiceConfigVariables.
@Test
public void getServiceConfigVariables() {
BlueprintView blueprintView = getMockBlueprintView("7.2.0", "7.1.0");
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setType(HUE);
rdsConfig.setConnectionURL(String.format("jdbc:%s://%s:%s/%s", DB_PROVIDER, HOST, PORT, DB_NAME));
rdsConfig.setConnectionUserName(USER_NAME);
rdsConfig.setConnectionPassword(PASSWORD);
TemplatePreparationObject tpo = new Builder().withRdsConfigs(Set.of(rdsConfig)).withBlueprintView(blueprintView).build();
List<ApiClusterTemplateVariable> result = underTest.getServiceConfigVariables(tpo);
Map<String, String> paramToVariable = result.stream().collect(Collectors.toMap(ApiClusterTemplateVariable::getName, ApiClusterTemplateVariable::getValue));
assertThat(paramToVariable).containsOnly(new SimpleEntry<>("hue-hue_database_host", HOST), new SimpleEntry<>("hue-hue_database_port", PORT), new SimpleEntry<>("hue-hue_database_name", DB_NAME), new SimpleEntry<>("hue-hue_database_type", DB_PROVIDER), new SimpleEntry<>("hue-hue_database_user", USER_NAME), new SimpleEntry<>("hue-hue_database_password", PASSWORD));
}
Aggregations