@Test public void resetClusterConfig_nonExistingCluster_throwsNotFound() throws Exception { expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.empty())); replay(clusterManager); try { clusterConfigManager.deleteClusterConfig( CLUSTER_ID, ClusterConfig.Type.BROKER, CONFIG_1.getName()).get(); fail(); } catch (ExecutionException e) { assertEquals(NotFoundException.class, e.getCause().getClass()); } verify(clusterManager); }
@Override public CompletableFuture<Void> deleteClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return unsafeResetConfig(clusterId, new ConfigResource(type.getAdminType(), ""), name); }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<Void> deleteClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return unsafeResetConfig(clusterId, new ConfigResource(type.getAdminType(), ""), name); } }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<Void> deleteClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return unsafeResetConfig(clusterId, new ConfigResource(type.getAdminType(), ""), name); } @Inject  ClusterConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); }
ClusterConfigManagerImpl extends AbstractConfigManager<ClusterConfig, ClusterConfig.Builder> implements ClusterConfigManager { @Override public CompletableFuture<Void> deleteClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return unsafeResetConfig(clusterId, new ConfigResource(type.getAdminType(), ""), 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<Void> deleteClusterConfig( String clusterId, ClusterConfig.Type type, String name) { return unsafeResetConfig(clusterId, new ConfigResource(type.getAdminType(), ""), 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);  }