use of com.sabre.oss.conf4j.source.MapConfigurationSource in project open-kilda by telstra.
the class DefaultConfigurationTest method shouldSetDefaultValueIfNotProvided.
@Test
public void shouldSetDefaultValueIfNotProvided() {
// given
MapConfigurationSource source = new MapConfigurationSource(emptyMap());
// when
KafkaTopicsConfig kafkaTopicsConfig = factory.createConfiguration(KafkaTopicsConfig.class, source);
// then
assertEquals("kilda.ctrl", kafkaTopicsConfig.getCtrlTopic());
}
use of com.sabre.oss.conf4j.source.MapConfigurationSource in project open-kilda by telstra.
the class MappingConfigurationValueProcessorTest method shouldPerformMappingForMatchedTarget.
@Test
public void shouldPerformMappingForMatchedTarget() {
// given
MapConfigurationSource source = new MapConfigurationSource(ImmutableMap.of("test_key", TEST_VALUE));
// when
factory.createConfiguration(TestConfig.class, source);
// then
verify(mappingStrategy).apply(eq(TEST_MAPPING_TARGET), eq(TEST_VALUE));
}
use of com.sabre.oss.conf4j.source.MapConfigurationSource in project open-kilda by telstra.
the class CompositeConfigurationTest method shouldProcessCompositeConfigs.
@Test
public void shouldProcessCompositeConfigs() {
// given
MapConfigurationSource source = new MapConfigurationSource(ImmutableMap.of("test_key", "10"));
// when
TestCompositeConfig testCompositeConfig = factory.createConfiguration(TestCompositeConfig.class, source);
// then
assertEquals(10, testCompositeConfig.getTestProperty());
}
use of com.sabre.oss.conf4j.source.MapConfigurationSource in project open-kilda by telstra.
the class KafkaNamingForConfigurationValueProcessorTest method shouldApplyMappingStrategyToDefaultValue.
@Test
public void shouldApplyMappingStrategyToDefaultValue() {
// given
MapConfigurationSource source = new MapConfigurationSource(emptyMap());
// when
KafkaTopicsConfig kafkaTopicsConfig = factory.createConfiguration(KafkaTopicsConfig.class, source);
// then
assertEquals(TEST_PREFIX + "_kilda.ctrl", kafkaTopicsConfig.getCtrlTopic());
}
Aggregations