Search in sources :

Example 1 with KafkaTopicsConfig

use of org.openkilda.config.KafkaTopicsConfig in project open-kilda by telstra.

the class KafkaNamingForConfigurationValueProcessorTest method shouldApplyNamingToProvidedValue.

@Test
public void shouldApplyNamingToProvidedValue() {
    // given
    MapConfigurationSource source = new MapConfigurationSource(ImmutableMap.of("kafka.topic.ctrl", TEST_VALUE));
    // when
    KafkaTopicsConfig kafkaTopicsConfig = factory.createConfiguration(KafkaTopicsConfig.class, source);
    // then
    assertEquals(TEST_PREFIX + "_" + TEST_VALUE, kafkaTopicsConfig.getCtrlTopic());
}
Also used : KafkaTopicsConfig(org.openkilda.config.KafkaTopicsConfig) MapConfigurationSource(com.sabre.oss.conf4j.source.MapConfigurationSource) Test(org.junit.Test)

Example 2 with KafkaTopicsConfig

use of org.openkilda.config.KafkaTopicsConfig 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());
}
Also used : KafkaTopicsConfig(org.openkilda.config.KafkaTopicsConfig) MapConfigurationSource(com.sabre.oss.conf4j.source.MapConfigurationSource) Test(org.junit.Test)

Aggregations

MapConfigurationSource (com.sabre.oss.conf4j.source.MapConfigurationSource)2 Test (org.junit.Test)2 KafkaTopicsConfig (org.openkilda.config.KafkaTopicsConfig)2