use of org.eclipse.hono.client.kafka.CommonKafkaClientConfigProperties in project hono by eclipse.
the class KafkaConsumerConfigPropertiesTest method testThatGetConsumerConfigReturnsGivenPropertiesWithCommonProperties.
/**
* Verifies that properties provided with {@link KafkaConsumerConfigProperties#setConsumerConfig(Map)} and
* {@link AbstractKafkaConfigProperties#setCommonClientConfig(CommonKafkaClientConfigProperties)} are returned in
* {@link KafkaConsumerConfigProperties#getConsumerConfig(String)}, with the consumer config properties having
* precedence.
*/
@Test
public void testThatGetConsumerConfigReturnsGivenPropertiesWithCommonProperties() {
final CommonKafkaClientConfigProperties commonConfig = new CommonKafkaClientConfigProperties();
commonConfig.setCommonClientConfig(Map.of("foo", "toBeOverridden", "common", "commonValue"));
config.setCommonClientConfig(commonConfig);
config.setConsumerConfig(Map.of("foo", "bar"));
final Map<String, String> consumerConfig = config.getConsumerConfig("consumerName");
assertThat(consumerConfig.get("foo")).isEqualTo("bar");
assertThat(consumerConfig.get("common")).isEqualTo("commonValue");
}
Aggregations