@Test public void testListShardsSingleResponse() { final List<Shard> expectedShards = new ArrayList<>(); final ListShardsResponse listShardsResponse = ListShardsResponse.builder().nextToken(null) .shards(expectedShards).build(); final CompletableFuture<ListShardsResponse> future = CompletableFuture.completedFuture(listShardsResponse); when(client.listShards(any(ListShardsRequest.class))).thenReturn(future); final List<Shard> shards = shardDetector.listShards(); assertThat(shards, equalTo(expectedShards)); verify(client).listShards(any(ListShardsRequest.class)); }
@Override @Synchronized public List<Shard> listShards() { return listShardsWithFilter(null); }
KinesisShardDetector implements ShardDetector { @Override @Synchronized public List<Shard> listShards() { return listShardsWithFilter(null); } }
KinesisShardDetector implements ShardDetector { @Override @Synchronized public List<Shard> listShards() { return listShardsWithFilter(null); } @Deprecated  KinesisShardDetector(KinesisAsyncClient kinesisClient, String streamName, long listShardsBackoffTimeInMillis,
            int maxListShardsRetryAttempts, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload,
            int cacheMissWarningModulus);  KinesisShardDetector(KinesisAsyncClient kinesisClient, StreamIdentifier streamIdentifier, long listShardsBackoffTimeInMillis,
            int maxListShardsRetryAttempts, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload,
            int cacheMissWarningModulus, Duration kinesisRequestTimeout); }
KinesisShardDetector implements ShardDetector { @Override @Synchronized public List<Shard> listShards() { return listShardsWithFilter(null); } @Deprecated  KinesisShardDetector(KinesisAsyncClient kinesisClient, String streamName, long listShardsBackoffTimeInMillis,
            int maxListShardsRetryAttempts, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload,
            int cacheMissWarningModulus);  KinesisShardDetector(KinesisAsyncClient kinesisClient, StreamIdentifier streamIdentifier, long listShardsBackoffTimeInMillis,
            int maxListShardsRetryAttempts, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload,
            int cacheMissWarningModulus, Duration kinesisRequestTimeout); @Override Shard shard(@NonNull final String shardId); @Override @Synchronized List<Shard> listShards(); @Override @Synchronized List<Shard> listShardsWithFilter(ShardFilter shardFilter); @Override ListShardsResponse getListShardsResponse(ListShardsRequest request); @Override List<ChildShard> getChildShards(final String shardId); }
KinesisShardDetector implements ShardDetector { @Override @Synchronized public List<Shard> listShards() { return listShardsWithFilter(null); } @Deprecated  KinesisShardDetector(KinesisAsyncClient kinesisClient, String streamName, long listShardsBackoffTimeInMillis,
            int maxListShardsRetryAttempts, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload,
            int cacheMissWarningModulus);  KinesisShardDetector(KinesisAsyncClient kinesisClient, StreamIdentifier streamIdentifier, long listShardsBackoffTimeInMillis,
            int maxListShardsRetryAttempts, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload,
            int cacheMissWarningModulus, Duration kinesisRequestTimeout); @Override Shard shard(@NonNull final String shardId); @Override @Synchronized List<Shard> listShards(); @Override @Synchronized List<Shard> listShardsWithFilter(ShardFilter shardFilter); @Override ListShardsResponse getListShardsResponse(ListShardsRequest request); @Override List<ChildShard> getChildShards(final String shardId);  }