@Test public void getClusterConfig_existingConfig_returnsConfig() 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); ClusterConfig config = clusterConfigManager.getClusterConfig( CLUSTER_ID, ClusterConfig.Type.BROKER, CONFIG_1.getName()) .get() .get(); assertEquals(CONFIG_1, config); }
@Override public CompletableFuture<Optional<ClusterConfig>> getClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return getConfig( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type), name); }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<Optional<ClusterConfig>> getClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return getConfig( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type), name); } }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<Optional<ClusterConfig>> getClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return getConfig( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type), name); } @Inject  ClusterConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<Optional<ClusterConfig>> getClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return getConfig( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type), name); } @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<Optional<ClusterConfig>> getClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return getConfig( clusterId, new ConfigResource(type.getAdminType(), ""), ClusterConfig.builder().setClusterId(clusterId).setType(type), name); } @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);  }