use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class KafkaDatahubConfigProviderTest method isConfigurationNeeded.
@ParameterizedTest
@EnumSource(StackType.class)
void isConfigurationNeeded(StackType stackType) {
TemplatePreparationObject tpo = templatePreparationObject(stackType, null);
boolean expectedIsNeeded = 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 KafkaDelegationTokenConfigProviderTest method testIsConfigurationNeededShouldReturnTrueWhenKafkaBrokerRoleTypeAndKafkaServiceAreAvailableAndKerberosIsEnabled.
@Test
void testIsConfigurationNeededShouldReturnTrueWhenKafkaBrokerRoleTypeAndKafkaServiceAreAvailableAndKerberosIsEnabled() {
KerberosConfig kerberosConfig = KerberosConfig.KerberosConfigBuilder.aKerberosConfig().build();
TemplatePreparationObject templatePreparationObject = TemplatePreparationObject.Builder.builder().withKerberosConfig(kerberosConfig).build();
when(cmTemplateProcessor.isRoleTypePresentInService(underTest.getServiceType(), underTest.getRoleTypes())).thenReturn(Boolean.TRUE);
boolean result = underTest.isConfigurationNeeded(cmTemplateProcessor, templatePreparationObject);
Assertions.assertTrue(result);
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class KafkaDelegationTokenConfigProviderTest method testIsConfigurationNeededWhenKerberosIsNotEnabled.
@Test
void testIsConfigurationNeededWhenKerberosIsNotEnabled() {
TemplatePreparationObject templatePreparationObject = TemplatePreparationObject.Builder.builder().build();
boolean result = underTest.isConfigurationNeeded(null, templatePreparationObject);
Assertions.assertFalse(result);
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class KafkaDelegationTokenConfigProviderTest method testIsConfigurationNeededWhenNoKafkaBrokerRoleType.
@Test
void testIsConfigurationNeededWhenNoKafkaBrokerRoleType() {
KerberosConfig kerberosConfig = KerberosConfig.KerberosConfigBuilder.aKerberosConfig().build();
TemplatePreparationObject templatePreparationObject = TemplatePreparationObject.Builder.builder().withKerberosConfig(kerberosConfig).build();
when(cmTemplateProcessor.isRoleTypePresentInService(underTest.getServiceType(), underTest.getRoleTypes())).thenReturn(Boolean.FALSE);
boolean result = underTest.isConfigurationNeeded(cmTemplateProcessor, templatePreparationObject);
Assertions.assertFalse(result);
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class KafkaMultiAzConfigProviderTest method getRoleConfigs.
@ParameterizedTest
@MethodSource("testArgsForGetRoleConfigs")
void getRoleConfigs(String cdhMainVersion, String cdhParcelVersion, Collection<ApiClusterTemplateConfig> expectedConfigs) {
when(blueprintView.getProcessor()).thenReturn(cmTemplateProcessor);
when(cmTemplateProcessor.getStackVersion()).thenReturn(cdhMainVersion);
TemplatePreparationObject tpo = templatePreparationObject(StackType.DATALAKE, cdhParcelVersion);
List<ApiClusterTemplateConfig> serviceConfigs = configProviderUnderTest.getRoleConfigs(KafkaRoles.KAFKA_BROKER, tpo);
assertThat(serviceConfigs).as("Expected configs for cdh version: %s / %s", cdhMainVersion, cdhParcelVersion).hasSameElementsAs(expectedConfigs);
}
Aggregations