use of org.apache.druid.metadata.MapStringDynamicConfigProvider in project druid by druid-io.
the class KafkaRecordSupplierTest method testAddConsumerPropertiesFromConfig.
@Test
public void testAddConsumerPropertiesFromConfig() {
DynamicConfigProvider dynamicConfigProvider = new MapStringDynamicConfigProvider(ImmutableMap.of("kafka.prop.2", "value.2", KafkaSupervisorIOConfig.TRUST_STORE_PASSWORD_KEY, "pwd2"));
Properties properties = new Properties();
Map<String, Object> consumerProperties = ImmutableMap.of(KafkaSupervisorIOConfig.TRUST_STORE_PASSWORD_KEY, "pwd1", "kafka.prop.1", "value.1", "druid.dynamic.config.provider", OBJECT_MAPPER.convertValue(dynamicConfigProvider, Map.class));
KafkaRecordSupplier.addConsumerPropertiesFromConfig(properties, OBJECT_MAPPER, consumerProperties);
Assert.assertEquals(3, properties.size());
Assert.assertEquals("value.1", properties.getProperty("kafka.prop.1"));
Assert.assertEquals("value.2", properties.getProperty("kafka.prop.2"));
Assert.assertEquals("pwd2", properties.getProperty(KafkaSupervisorIOConfig.TRUST_STORE_PASSWORD_KEY));
}
Aggregations