public void Can_use_configuration_value_from_source_with_environment_naming_convention_and_prefix() { var sut = new ConsumerConfigurationBuilder(); sut.WithConfigurationSource(new ConfigurationSourceStub( (key: "DEFAULT_KAFKA_GROUP_ID", value: "foo"), (key: "DEFAULT_KAFKA_BOOTSTRAP_SERVERS", value: "bar") )); sut.WithEnvironmentStyle("DEFAULT_KAFKA"); var configuration = sut.Build(); AssertKeyValue(configuration, ConfigurationKey.GroupId, "foo"); AssertKeyValue(configuration, ConfigurationKey.BootstrapServers, "bar"); }
public void Only_take_value_from_first_source_that_matches() { var sut = new ConsumerConfigurationBuilder(); sut.WithConfigurationSource(new ConfigurationSourceStub( (key: ConfigurationKey.GroupId, value: "foo"), (key: ConfigurationKey.BootstrapServers, value: "bar"), (key: "GROUP_ID", value: "baz") )); sut.WithNamingConvention(NamingConvention.Default); sut.WithEnvironmentStyle(); var configuration = sut.Build(); AssertKeyValue(configuration, ConfigurationKey.GroupId, "foo"); }