ConfigUtil { public static Properties toConsumerConfig(Config config) { val keys = new String[]{ ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, ConsumerConfig.GROUP_ID_CONFIG, ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG }; val props = new Properties(); copyProps(config, props, keys); return props; }  static Properties toConsumerConfig(Config config); static Properties toProducerConfig(Config config);  }
@Test public void testToConsumerConfig() { val config = ConfigFactory.load("consumer.conf"); val props = ConfigUtil.toConsumerConfig(config); assertEquals(BOOTSTRAP_SERVERS, props.getProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG)); assertEquals(GROUP_ID, props.getProperty(ConsumerConfig.GROUP_ID_CONFIG)); assertEquals(KEY_DESER, props.getProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG)); assertEquals(VALUE_DESER, props.getProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG)); }