use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class OozieHAConfigProviderTest method testGetServiceConfigsWithOozieHA.
@Test
public void testGetServiceConfigsWithOozieHA() {
String inputJson = getBlueprintText("input/de-ha.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
TemplatePreparationObject preparationObject = getTemplatePreparationObject(inputJson, cmTemplateProcessor, 2);
assertTrue(underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject));
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertEquals(3, serviceConfigs.size());
assertEquals("oozie_load_balancer", serviceConfigs.get(0).getName());
assertEquals("master0.blah.timbuk2.dev.cldr.", serviceConfigs.get(0).getValue());
assertEquals("oozie_load_balancer_http_port", serviceConfigs.get(1).getName());
assertEquals("11000", serviceConfigs.get(1).getValue());
assertEquals("oozie_load_balancer_https_port", serviceConfigs.get(2).getName());
assertEquals("11443", serviceConfigs.get(2).getValue());
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class OozieRoleConfigProviderTest method testGetRoleConfigsWithSingleRolesPerHostGroup.
@Test
public void testGetRoleConfigsWithSingleRolesPerHostGroup() {
String inputJson = getBlueprintText("input/clouderamanager-db-config.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
TemplatePreparationObject preparationObject = getTemplatePreparationObject(inputJson, cmTemplateProcessor, 1);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> oozieServer = roleConfigs.get("oozie-OOZIE_SERVER-BASE");
assertEquals(5, oozieServer.size());
assertEquals("oozie_database_host", oozieServer.get(0).getName());
assertEquals("testhost", oozieServer.get(0).getValue());
assertEquals("oozie_database_name", oozieServer.get(1).getName());
assertEquals("ooziedb", oozieServer.get(1).getValue());
assertEquals("oozie_database_type", oozieServer.get(2).getName());
assertEquals("postgresql", oozieServer.get(2).getValue());
assertEquals("oozie_database_user", oozieServer.get(3).getName());
assertEquals("testuser", oozieServer.get(3).getValue());
assertEquals("oozie_database_password", oozieServer.get(4).getName());
assertEquals("testpassword", oozieServer.get(4).getValue());
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class OozieRoleConfigProviderTest method testGetRoleConfigsWithNoOozie.
@Test
public void testGetRoleConfigsWithNoOozie() {
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
TemplatePreparationObject preparationObject = getTemplatePreparationObject(inputJson, cmTemplateProcessor, 1);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> oozieServer = roleConfigs.get("oozie-OOZIE_SERVER-BASE");
assertNull(oozieServer);
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class OozieRoleConfigProviderTest method testGetRoleConfigsWithOozieHA.
@Test
public void testGetRoleConfigsWithOozieHA() {
String inputJson = getBlueprintText("input/de-ha.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
TemplatePreparationObject preparationObject = getTemplatePreparationObject(inputJson, cmTemplateProcessor, 2);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> oozieServer = roleConfigs.get("oozie-OOZIE_SERVER-BASE");
assertEquals(5, oozieServer.size());
assertEquals("oozie_database_host", oozieServer.get(0).getName());
assertEquals("testhost", oozieServer.get(0).getValue());
assertEquals("oozie_database_name", oozieServer.get(1).getName());
assertEquals("ooziedb", oozieServer.get(1).getValue());
assertEquals("oozie_database_type", oozieServer.get(2).getName());
assertEquals("postgresql", oozieServer.get(2).getValue());
assertEquals("oozie_database_user", oozieServer.get(3).getName());
assertEquals("testuser", oozieServer.get(3).getValue());
assertEquals("oozie_database_password", oozieServer.get(4).getName());
assertEquals("testpassword", oozieServer.get(4).getValue());
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig 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());
}
Aggregations