Search in sources :

Example 66 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProviderTest method getServiceConfigsTestDatalakeAndNoLdap.

@Test
void getServiceConfigsTestDatalakeAndNoLdap() {
    TemplatePreparationObject tpo = new TemplatePreparationObject.Builder().withRdsConfigs(Set.of(createRdsConfig(null))).withProductDetails(generateCmRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_2_2), null).withStackType(StackType.DATALAKE).build();
    List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(templateProcessor, tpo);
    verifyDbOnlyMinimalResult(result);
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 67 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProviderTest method getServiceConfigsTestDatahubCm711.

@Test
void getServiceConfigsTestDatahubCm711() {
    TemplatePreparationObject tpo = new TemplatePreparationObject.Builder().withRdsConfigs(Set.of(createRdsConfig(null))).withProductDetails(generateCmRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_1_1), null).withStackType(StackType.WORKLOAD).build();
    List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(templateProcessor, tpo);
    Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
    assertThat(configNameToValueMap).containsOnly(entry(HIVE_METASTORE_DATABASE_HOST, "10.1.1.1"), entry(HIVE_METASTORE_DATABASE_NAME, "hive"), entry(HIVE_METASTORE_DATABASE_PASSWORD, "iamsoosecure"), entry(HIVE_METASTORE_DATABASE_PORT, "5432"), entry(HIVE_METASTORE_DATABASE_TYPE, "postgresql"), entry(HIVE_METASTORE_DATABASE_USER, "heyitsme"), entry(HIVE_COMPACTOR_INITIATOR_ON, "false"));
    Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
    assertThat(configNameToVariableNameMap).isEmpty();
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 68 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProviderTest method getServiceConfigsTestDatalakeWithLdap.

@Test
void getServiceConfigsTestDatalakeWithLdap() {
    TemplatePreparationObject tpo = new TemplatePreparationObject.Builder().withRdsConfigs(Set.of(createRdsConfig(null))).withProductDetails(generateCmRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_2_2), null).withStackType(StackType.DATALAKE).withLdapConfig(ldapConfig()).build();
    List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(templateProcessor, tpo);
    Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
    assertThat(configNameToValueMap).containsOnly(entry(HIVE_METASTORE_DATABASE_HOST, "10.1.1.1"), entry(HIVE_METASTORE_DATABASE_NAME, "hive"), entry(HIVE_METASTORE_DATABASE_PASSWORD, "iamsoosecure"), entry(HIVE_METASTORE_DATABASE_PORT, "5432"), entry(HIVE_METASTORE_DATABASE_TYPE, "postgresql"), entry(HIVE_METASTORE_DATABASE_USER, "heyitsme"), entry(HIVE_METASTORE_ENABLE_LDAP_AUTH, Boolean.TRUE.toString()), entry(HIVE_METASTORE_LDAP_URI, "ldap://localhost:389"), entry(HIVE_METASTORE_LDAP_BASEDN, "cn=users,dc=example,dc=org"));
    Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
    assertThat(configNameToVariableNameMap).isEmpty();
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 69 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProviderTest method getRoleConfigsTest.

@Test
void getRoleConfigsTest() {
    TemplatePreparationObject tpo = new TemplatePreparationObject.Builder().build();
    List<ApiClusterTemplateConfig> result = underTest.getRoleConfigs(HiveRoles.HIVEMETASTORE, tpo);
    Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
    assertThat(configNameToValueMap).containsOnly(entry(METASTORE_CANARY_HEALTH_ENABLED, Boolean.FALSE.toString()));
    Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
    assertThat(configNameToVariableNameMap).isEmpty();
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 70 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProviderTest method getServiceConfigsTestDbOnlyWithSsl.

@Test
void getServiceConfigsTestDbOnlyWithSsl() {
    TemplatePreparationObject tpo = new TemplatePreparationObject.Builder().withRdsConfigs(Set.of(createRdsConfig(RdsSslMode.ENABLED))).withRdsSslCertificateFilePath(SSL_CERTS_FILE_PATH).withProductDetails(generateCmRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_2_2), null).build();
    List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(templateProcessor, tpo);
    verifyDbOnlySslResult(result);
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)172 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)129 Test (org.junit.Test)78 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)74 Test (org.junit.jupiter.api.Test)57 ArrayList (java.util.ArrayList)55 List (java.util.List)50 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)25 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)22 Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)21 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)18 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)17 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)17 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)13 AccountMappingView (com.sequenceiq.cloudbreak.template.views.AccountMappingView)13 ApiClusterTemplateRoleConfigGroup (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup)12 HashMap (java.util.HashMap)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)11 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)9 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)8