use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class DasConfigProviderTest method isConfigurationNeededFalseWhenNoDasOnClusterr.
@Test
@SuppressWarnings("unchecked")
public void isConfigurationNeededFalseWhenNoDasOnClusterr() {
CmTemplateProcessor mockTemplateProcessor = mock(CmTemplateProcessor.class);
when(mockTemplateProcessor.isRoleTypePresentInService(anyString(), any(List.class))).thenReturn(false);
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setType(HIVE_DAS);
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)).build();
boolean result = underTest.isConfigurationNeeded(mockTemplateProcessor, tpo);
assertThat(result).isFalse();
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class DasConfigProviderTest method isConfigurationNeededFalseWhenNoDBRegistered.
@Test
@SuppressWarnings("unchecked")
public void isConfigurationNeededFalseWhenNoDBRegistered() {
CmTemplateProcessor mockTemplateProcessor = mock(CmTemplateProcessor.class);
when(mockTemplateProcessor.isRoleTypePresentInService(anyString(), any(List.class))).thenReturn(true);
TemplatePreparationObject tpo = new Builder().build();
boolean result = underTest.isConfigurationNeeded(mockTemplateProcessor, tpo);
assertThat(result).isFalse();
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class FlinkCloudStorageConfigProviderTest method testGetFlinkCloudStorageServiceConfigs.
@Test
public void testGetFlinkCloudStorageServiceConfigs() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(true);
String inputJson = getBlueprintText("input/flink.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
Map<String, String> actual = serviceConfigs.stream().collect(Collectors.toMap(ApiClusterTemplateConfig::getName, ApiClusterTemplateConfig::getValue));
Map<String, String> expectedServiceConfigs = Map.of(JOBMANAGER_ARCHIVE_FS_DIR_NAME, JOBMANAGER_ARCHIVE_FS_DIR_VALUE, STATE_CHECKPOINTS_DIR_NAME, STATE_CHECKPOINTS_DIR_VALUE, STATE_SAVEPOINTS_DIR_NAME, STATE_SAVEPOINTS_DIR_VALUE, HIGH_AVAILABILITY_STORAGE_DIR_NAME, HIGH_AVAILABILITY_STORAGE_DIR_VALUE);
assertEquals(expectedServiceConfigs, actual);
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class FlinkCloudStorageConfigProviderTest method testGetFlinkCloudStorageServiceConfigsWhenNoCloudStorageProvided.
@Test
public void testGetFlinkCloudStorageServiceConfigsWhenNoCloudStorageProvided() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(false);
String inputJson = getBlueprintText("input/flink.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertEquals(0, serviceConfigs.size());
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class FlinkCloudStorageConfigProviderTest method testGetFlinkCloudStorageRoleConfigsWhenNoCloudStorageProvided.
@Test
public void testGetFlinkCloudStorageRoleConfigsWhenNoCloudStorageProvided() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(false);
String inputJson = getBlueprintText("input/flink.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> flinkRoleConfigs = roleConfigs.get("flink-FLINK_HISTORY_SERVER-BASE");
assertEquals(0, flinkRoleConfigs.size());
}
Aggregations