mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 23:59:27 -05:00
fix(kinesis): cap ListShards page size at 1000 (#8387)
This commit is contained in:
1 parent
92a61c2b86
commit
4fc41cc683
2 files changed
+25
-1
No files matched your search
@@ -2305,6 +2305,27 @@ class KinesisJsonHandlerTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void listShardsCapsPageAt1000EvenWhenMaxResultsIsLarger() {
|
||||
createStream("test-stream", 1001);
|
||||
|
||||
ObjectNode first = MAPPER.createObjectNode();
|
||||
first.put("StreamName", "test-stream");
|
||||
first.put("MaxResults", 10000);
|
||||
ObjectNode firstPage = responseEntity(handler.handle("ListShards", first, REGION));
|
||||
|
||||
assertEquals(1000, firstPage.get("Shards").size());
|
||||
assertTrue(firstPage.hasNonNull("NextToken"), "a token is returned for the remaining shard");
|
||||
|
||||
ObjectNode second = MAPPER.createObjectNode();
|
||||
second.put("NextToken", firstPage.get("NextToken").asText());
|
||||
second.put("MaxResults", 10000);
|
||||
ObjectNode secondPage = responseEntity(handler.handle("ListShards", second, REGION));
|
||||
|
||||
assertEquals(1, secondPage.get("Shards").size());
|
||||
assertFalse(secondPage.hasNonNull("NextToken"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void listShardsRejectsStreamNameTogetherWithNextToken() {
|
||||
createStream("test-stream", 3);
|
||||
|
||||
Reference in new issue
Block a user