use of io.confluent.kafkarest.entities.BrokerConfig in project kafka-rest by confluentinc.
the class BrokerConfigManagerImplTest method getBrokerConfig_existingConfig_returnsConfig.
@Test
public void getBrokerConfig_existingConfig_returnsConfig() throws Exception {
expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.of(CLUSTER)));
expect(adminClient.describeConfigs(eq(singletonList(new ConfigResource(ConfigResource.Type.BROKER, String.valueOf(BROKER_ID)))), anyObject(DescribeConfigsOptions.class))).andReturn(describeConfigsResult);
expect(describeConfigsResult.all()).andReturn(KafkaFuture.completedFuture(singletonMap(new ConfigResource(ConfigResource.Type.BROKER, String.valueOf(BROKER_ID)), CONFIG)));
replay(adminClient, clusterManager, describeConfigsResult);
BrokerConfig config = brokerConfigManager.getBrokerConfig(CLUSTER_ID, BROKER_ID, CONFIG_1.getName()).get().get();
assertEquals(CONFIG_1, config);
}
Aggregations