@Test public void listConsumers_returnsConsumers() throws Exception { expect(consumerGroupManager.getConsumerGroup(CLUSTER_ID, CONSUMER_GROUP.getConsumerGroupId())) .andReturn(completedFuture(Optional.of(CONSUMER_GROUP))); replay(consumerGroupManager); List<Consumer> consumerGroups = consumerManager.listConsumers(CLUSTER_ID, CONSUMER_GROUP.getConsumerGroupId()).get(); assertEquals(Arrays.asList(CONSUMERS), consumerGroups); }
@Override public CompletableFuture<List<Consumer>> listConsumers(String clusterId, String consumerGroupId) { return consumerGroupManager.getConsumerGroup(clusterId, consumerGroupId) .thenApply( consumerGroup -> checkEntityExists( consumerGroup, "Consumer Group %s does not exist.", consumerGroupId)) .thenApply(ConsumerGroup::getConsumers); }
ConsumerManagerImpl implements ConsumerManager { @Override public CompletableFuture<List<Consumer>> listConsumers(String clusterId, String consumerGroupId) { return consumerGroupManager.getConsumerGroup(clusterId, consumerGroupId) .thenApply( consumerGroup -> checkEntityExists( consumerGroup, "Consumer Group %s does not exist.", consumerGroupId)) .thenApply(ConsumerGroup::getConsumers); } }
ConsumerManagerImpl implements ConsumerManager { @Override public CompletableFuture<List<Consumer>> listConsumers(String clusterId, String consumerGroupId) { return consumerGroupManager.getConsumerGroup(clusterId, consumerGroupId) .thenApply( consumerGroup -> checkEntityExists( consumerGroup, "Consumer Group %s does not exist.", consumerGroupId)) .thenApply(ConsumerGroup::getConsumers); } @Inject  ConsumerManagerImpl(ConsumerGroupManager consumerGroupManager); }
ConsumerManagerImpl implements ConsumerManager { @Override public CompletableFuture<List<Consumer>> listConsumers(String clusterId, String consumerGroupId) { return consumerGroupManager.getConsumerGroup(clusterId, consumerGroupId) .thenApply( consumerGroup -> checkEntityExists( consumerGroup, "Consumer Group %s does not exist.", consumerGroupId)) .thenApply(ConsumerGroup::getConsumers); } @Inject  ConsumerManagerImpl(ConsumerGroupManager consumerGroupManager); @Override CompletableFuture<List<Consumer>> listConsumers(String clusterId, String consumerGroupId); @Override CompletableFuture<Optional<Consumer>> getConsumer(
      String clusterId, String consumerGroupId, String consumerId); }
ConsumerManagerImpl implements ConsumerManager { @Override public CompletableFuture<List<Consumer>> listConsumers(String clusterId, String consumerGroupId) { return consumerGroupManager.getConsumerGroup(clusterId, consumerGroupId) .thenApply( consumerGroup -> checkEntityExists( consumerGroup, "Consumer Group %s does not exist.", consumerGroupId)) .thenApply(ConsumerGroup::getConsumers); } @Inject  ConsumerManagerImpl(ConsumerGroupManager consumerGroupManager); @Override CompletableFuture<List<Consumer>> listConsumers(String clusterId, String consumerGroupId); @Override CompletableFuture<Optional<Consumer>> getConsumer(
      String clusterId, String consumerGroupId, String consumerId);  }