Search in sources :

Example 6 with MapConfigurationSource

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

Example 7 with MapConfigurationSource

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

Example 8 with MapConfigurationSource

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

Example 9 with MapConfigurationSource

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());
}
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)9 Test (org.junit.Test)8 KafkaTopicsConfig (org.openkilda.config.KafkaTopicsConfig)2 JdkProxyStaticConfigurationFactory (com.sabre.oss.conf4j.factory.jdkproxy.JdkProxyStaticConfigurationFactory)1 IFloodlightProviderService (net.floodlightcontroller.core.IFloodlightProviderService)1 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)1 SwitchDescription (net.floodlightcontroller.core.SwitchDescription)1 IOFSwitchService (net.floodlightcontroller.core.internal.IOFSwitchService)1 IRestApiService (net.floodlightcontroller.restserver.IRestApiService)1 Before (org.junit.Before)1 KildaCore (org.openkilda.floodlight.KildaCore)1 KildaCoreConfig (org.openkilda.floodlight.KildaCoreConfig)1 FloodlightModuleConfigurationProvider (org.openkilda.floodlight.config.provider.FloodlightModuleConfigurationProvider)1 IPathVerificationService (org.openkilda.floodlight.pathverification.IPathVerificationService)1 PathVerificationService (org.openkilda.floodlight.pathverification.PathVerificationService)1 PathVerificationServiceConfig (org.openkilda.floodlight.pathverification.PathVerificationServiceConfig)1 FeatureDetectorService (org.openkilda.floodlight.service.FeatureDetectorService)1 SwitchFlowFactory (org.openkilda.floodlight.switchmanager.factory.SwitchFlowFactory)1