@Test public void listClusterConfigs_existingCluster_returnsConfigs() throws Exception { expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.of(CLUSTER))); expect( adminClient.describeConfigs( eq(singletonList(new ConfigResource(ConfigResource.Type.BROKER, ""))), anyObject(DescribeConfigsOptions.class))) .andReturn(describeConfigsResult); expect(describeConfigsResult.values()) .andReturn( singletonMap( new ConfigResource(ConfigResource.Type.BROKER, ""), KafkaFuture.completedFuture(CONFIG))); replay(adminClient, clusterManager, describeConfigsResult); List<ClusterConfig> configs = clusterConfigManager.listClusterConfigs(CLUSTER_ID, ClusterConfig.Type.BROKER).get(); assertEquals( new HashSet<>(Arrays.asList(CONFIG_1, CONFIG_2, CONFIG_3)), new HashSet<>(configs)); }
@Override public CompletableFuture<List<ClusterConfig>> listClusterConfigs( String clusterId, ClusterConfig.Type type) { return listConfigs( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type)); }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<List<ClusterConfig>> listClusterConfigs( String clusterId, ClusterConfig.Type type) { return listConfigs( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type)); } }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<List<ClusterConfig>> listClusterConfigs( String clusterId, ClusterConfig.Type type) { return listConfigs( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type)); } @Inject  ClusterConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<List<ClusterConfig>> listClusterConfigs( String clusterId, ClusterConfig.Type type) { return listConfigs( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type)); } @Inject  ClusterConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); @Override CompletableFuture<List<ClusterConfig>> listClusterConfigs(
      String clusterId, ClusterConfig.Type type); @Override CompletableFuture<Optional<ClusterConfig>> getClusterConfig(
      String clusterId, ClusterConfig.Type type, String name); @Override CompletableFuture<Void> upsertClusterConfig(
      String clusterId, ClusterConfig.Type type, String name, String newValue); @Override CompletableFuture<Void> deleteClusterConfig(
      String clusterId, ClusterConfig.Type type, String name); @Override CompletableFuture<Void> alterClusterConfigs(
      String clusterId, ClusterConfig.Type type, List<AlterConfigCommand> commands); }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<List<ClusterConfig>> listClusterConfigs( String clusterId, ClusterConfig.Type type) { return listConfigs( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type)); } @Inject  ClusterConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); @Override CompletableFuture<List<ClusterConfig>> listClusterConfigs(
      String clusterId, ClusterConfig.Type type); @Override CompletableFuture<Optional<ClusterConfig>> getClusterConfig(
      String clusterId, ClusterConfig.Type type, String name); @Override CompletableFuture<Void> upsertClusterConfig(
      String clusterId, ClusterConfig.Type type, String name, String newValue); @Override CompletableFuture<Void> deleteClusterConfig(
      String clusterId, ClusterConfig.Type type, String name); @Override CompletableFuture<Void> alterClusterConfigs(
      String clusterId, ClusterConfig.Type type, List<AlterConfigCommand> commands);  }