use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class KafkaMultiAzConfigProviderTest method isConfigurationNeeded.
@ParameterizedTest
@EnumSource(StackType.class)
void isConfigurationNeeded(StackType stackType) {
TemplatePreparationObject tpo = templatePreparationObject(stackType, null);
boolean expectedIsNeeded = stackType == StackType.DATALAKE || stackType == StackType.WORKLOAD;
assertThat(configProviderUnderTest.isConfigurationNeeded(null, tpo)).as("Configuration should %sbe needed for stack type %s", expectedIsNeeded ? "" : "NOT ", stackType).isEqualTo(expectedIsNeeded);
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class SqlStreamBuilderAdminDatabaseConfigProviderTest method testProperDbConfig.
@Test
public void testProperDbConfig() {
CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.11");
TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
List<ApiClusterTemplateConfig> roleConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertThat(roleConfigs).hasSameElementsAs(List.of(config("database_type", "postgresql"), config("database_host", "testhost"), config("database_port", "5432"), config("database_schema", "eventador_admin"), config("database_user", "ssb_test_user"), config("database_password", "ssb_test_pw")));
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class SqlStreamBuilderSnapperDatabaseConfigProviderTest method testNoConfigNeeded.
@Test
public void testNoConfigNeeded() {
CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.10");
TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
assertFalse(underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject));
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class TezRoleConfigProviderTest method testGetTezClientRoleConfigsWhenNoStorageConfigured.
@Test
public void testGetTezClientRoleConfigsWhenNoStorageConfigured() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject();
String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> tezConfigs = roleConfigs.get("tez-GATEWAY-BASE");
assertEquals(0, tezConfigs.size());
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class StackToTemplatePreparationObjectConverterTest method testConvertWhenClusterGivesGatewayThenNotNullShouldBeStored.
@Test
public void testConvertWhenClusterGivesGatewayThenNotNullShouldBeStored() {
Gateway gateway = mock(Gateway.class);
when(gateway.getSignKey()).thenReturn(null);
when(cluster.getGateway()).thenReturn(gateway);
when(blueprintViewProvider.getBlueprintView(any())).thenReturn(getBlueprintView());
TemplatePreparationObject result = underTest.convert(stackMock);
assertThat(result.getGatewayView()).isNotNull();
}
Aggregations