use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class HiveKnoxConfigProviderTest method isConfigurationNeeded.
@Test
void isConfigurationNeeded() {
when(cmTemplateProcessor.isRoleTypePresentInService(anyString(), anyList())).thenReturn(true);
TemplatePreparationObject tpo = Builder.builder().withKerberosConfig(KerberosConfig.KerberosConfigBuilder.aKerberosConfig().build()).build();
assertThat(underTest.isConfigurationNeeded(cmTemplateProcessor, tpo)).isTrue();
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class HiveKnoxConfigProviderTest method isConfigurationNotNeededWithRoleTypePresent.
@Test
void isConfigurationNotNeededWithRoleTypePresent() {
lenient().when(cmTemplateProcessor.isRoleTypePresentInService(anyString(), anyList())).thenReturn(true);
TemplatePreparationObject tpo = Builder.builder().build();
assertThat(underTest.isConfigurationNeeded(cmTemplateProcessor, tpo)).isFalse();
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class HiveKnoxConfigProviderTest method testGetServiceConfigs.
private void testGetServiceConfigs(Iterable<String> versions, Iterable<ApiClusterTemplateConfig> expectedConfigs) {
for (String version : versions) {
when(cmTemplateProcessor.getVersion()).thenReturn(Optional.ofNullable(version));
TemplatePreparationObject tpo = createTemplatePreparationObject();
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, tpo);
assertThat(serviceConfigs).as("Expected configs for cdh version: %s", version).hasSameElementsAs(expectedConfigs);
}
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class HiveKnoxConfigProviderTest method isConfigurationNotNeededWithRoleTypeNotPresent.
@Test
void isConfigurationNotNeededWithRoleTypeNotPresent() {
when(cmTemplateProcessor.isRoleTypePresentInService(anyString(), anyList())).thenReturn(false);
TemplatePreparationObject tpo = Builder.builder().withKerberosConfig(KerberosConfig.KerberosConfigBuilder.aKerberosConfig().build()).build();
assertThat(underTest.isConfigurationNeeded(cmTemplateProcessor, tpo)).isFalse();
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class HiveLLAPServiceConfigProviderTest method testGetHiveLlapServiceConfigsWhenNoStorageConfigured.
@Test
public void testGetHiveLlapServiceConfigsWhenNoStorageConfigured() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(false);
String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertEquals(0, serviceConfigs.size());
}
Aggregations