@Test public void alterBrokerConfigs_nonExistingCluster_throwsNotFound() throws Exception { expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.empty())); replay(clusterManager); try { brokerConfigManager.alterBrokerConfigs( CLUSTER_ID, BROKER_ID, Arrays.asList( AlterConfigCommand.set(CONFIG_1.getName(), "new-value"), AlterConfigCommand.delete(CONFIG_2.getName()))) .get(); fail(); } catch (ExecutionException e) { assertEquals(NotFoundException.class, e.getCause().getClass()); } }
@Override public CompletableFuture<Void> alterBrokerConfigs( String clusterId, int brokerId, List<AlterConfigCommand> commands) { return safeAlterConfigs( clusterId, new ConfigResource(ConfigResource.Type.BROKER, String.valueOf(brokerId)), BrokerConfig.builder().setClusterId(clusterId).setBrokerId(brokerId), commands); }
BrokerConfigManagerImpl extends AbstractConfigManager<BrokerConfig, BrokerConfig.Builder> implements BrokerConfigManager { @Override public CompletableFuture<Void> alterBrokerConfigs( String clusterId, int brokerId, List<AlterConfigCommand> commands) { return safeAlterConfigs( clusterId, new ConfigResource(ConfigResource.Type.BROKER, String.valueOf(brokerId)), BrokerConfig.builder().setClusterId(clusterId).setBrokerId(brokerId), commands); } }
BrokerConfigManagerImpl extends AbstractConfigManager<BrokerConfig, BrokerConfig.Builder> implements BrokerConfigManager { @Override public CompletableFuture<Void> alterBrokerConfigs( String clusterId, int brokerId, List<AlterConfigCommand> commands) { return safeAlterConfigs( clusterId, new ConfigResource(ConfigResource.Type.BROKER, String.valueOf(brokerId)), BrokerConfig.builder().setClusterId(clusterId).setBrokerId(brokerId), commands); } @Inject  BrokerConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); }
BrokerConfigManagerImpl extends AbstractConfigManager<BrokerConfig, BrokerConfig.Builder> implements BrokerConfigManager { @Override public CompletableFuture<Void> alterBrokerConfigs( String clusterId, int brokerId, List<AlterConfigCommand> commands) { return safeAlterConfigs( clusterId, new ConfigResource(ConfigResource.Type.BROKER, String.valueOf(brokerId)), BrokerConfig.builder().setClusterId(clusterId).setBrokerId(brokerId), commands); } @Inject  BrokerConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); @Override CompletableFuture<List<BrokerConfig>> listBrokerConfigs(
      String clusterId, int brokerId); @Override CompletableFuture<Optional<BrokerConfig>> getBrokerConfig(
      String clusterId, int brokerId, String name); @Override CompletableFuture<Void> updateBrokerConfig(
      String clusterId, int brokerId, String name, String newValue); @Override CompletableFuture<Void> resetBrokerConfig(
      String clusterId, int brokerId, String name); @Override CompletableFuture<Void> alterBrokerConfigs(
      String clusterId, int brokerId, List<AlterConfigCommand> commands); }
BrokerConfigManagerImpl extends AbstractConfigManager<BrokerConfig, BrokerConfig.Builder> implements BrokerConfigManager { @Override public CompletableFuture<Void> alterBrokerConfigs( String clusterId, int brokerId, List<AlterConfigCommand> commands) { return safeAlterConfigs( clusterId, new ConfigResource(ConfigResource.Type.BROKER, String.valueOf(brokerId)), BrokerConfig.builder().setClusterId(clusterId).setBrokerId(brokerId), commands); } @Inject  BrokerConfigManagerImpl(Admin adminClient, ClusterManager clusterManager); @Override CompletableFuture<List<BrokerConfig>> listBrokerConfigs(
      String clusterId, int brokerId); @Override CompletableFuture<Optional<BrokerConfig>> getBrokerConfig(
      String clusterId, int brokerId, String name); @Override CompletableFuture<Void> updateBrokerConfig(
      String clusterId, int brokerId, String name, String newValue); @Override CompletableFuture<Void> resetBrokerConfig(
      String clusterId, int brokerId, String name); @Override CompletableFuture<Void> alterBrokerConfigs(
      String clusterId, int brokerId, List<AlterConfigCommand> commands);  }