public StreamDescription unmarshall(JsonUnmarshallerContext context) throws Exception { StreamDescription streamDescription = new StreamDescription();
return null; StreamDescription streamDescription = new StreamDescription(); reader.beginObject(); while (reader.hasNext()) {
@Override public DescribeStreamResult describeStream(String streamName, String exclusiveStartShardId) { int nextShardId = 0; if (exclusiveStartShardId != null) { nextShardId = parseInt(exclusiveStartShardId) + 1; } boolean hasMoreShards = nextShardId + 1 < shardedData.size(); List<Shard> shards = new ArrayList<>(); if (nextShardId < shardedData.size()) { shards.add(new Shard().withShardId(Integer.toString(nextShardId))); } HttpResponse response = new HttpResponse(null, null); response.setStatusCode(200); DescribeStreamResult result = new DescribeStreamResult(); result.setSdkHttpMetadata(SdkHttpMetadata.from(response)); result.withStreamDescription( new StreamDescription() .withHasMoreShards(hasMoreShards) .withShards(shards) .withStreamName(streamName)); return result; }
public StreamDescription unmarshall(JsonUnmarshallerContext context) throws Exception { StreamDescription streamDescription = new StreamDescription();
@Test public void shouldListAllShards() throws Exception { Shard shard1 = new Shard().withShardId(SHARD_1); Shard shard2 = new Shard().withShardId(SHARD_2); Shard shard3 = new Shard().withShardId(SHARD_3); given(kinesis.describeStream(STREAM, null)) .willReturn( new DescribeStreamResult() .withStreamDescription( new StreamDescription().withShards(shard1, shard2).withHasMoreShards(true))); given(kinesis.describeStream(STREAM, SHARD_2)) .willReturn( new DescribeStreamResult() .withStreamDescription( new StreamDescription().withShards(shard3).withHasMoreShards(false))); List<Shard> shards = underTest.listShards(STREAM); assertThat(shards).containsOnly(shard1, shard2, shard3); }
.willReturn( new DescribeStreamResult() .withStreamDescription(new StreamDescription() .withStreamName(STREAM_FOR_RESHARDING) .withStreamStatus(StreamStatus.ACTIVE)
.withStreamDescription(new StreamDescription() .withStreamName(STREAM1) .withStreamStatus(StreamStatus.UPDATING)), new DescribeStreamResult() .withStreamDescription(new StreamDescription() .withStreamName(STREAM1) .withStreamStatus(StreamStatus.ACTIVE)