From da01dd282d89b2d5b2e30874924ef5a15472efa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Andr=C3=A9?= <92062874+matheusandre1@users.noreply.github.com> Date: Sun, 29 Nov 2026 13:26:50 -0300 Subject: [PATCH] test(apigateway): cover every pageById collection in the page cap test (#9752) ApiGatewayPageCapTest now also checks the 500-item cap on GetModels, GetDocumentationParts and GetBasePathMappings, so collections() lists every collection that pages through pageById. --- .../apigateway/ApiGatewayPageCapTest.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/test/java/io/floci/aws/services/apigateway/ApiGatewayPageCapTest.java b/src/test/java/io/floci/aws/services/apigateway/ApiGatewayPageCapTest.java index 0f2efe50f6..f2e0492f91 100644 --- a/src/test/java/io/floci/aws/services/apigateway/ApiGatewayPageCapTest.java +++ b/src/test/java/io/floci/aws/services/apigateway/ApiGatewayPageCapTest.java @@ -111,6 +111,35 @@ class ApiGatewayPageCapTest { return (limit, position) -> service.getRequestValidatorPage(REGION, apiId, limit, position); } + private static Pager models(ApiGatewayService service) { + String apiId = newApi(service); + for (int i = 0; service.getModels(REGION, apiId).size() < ITEMS; i++) { + service.createModel(REGION, apiId, Map.of("name", "capped" + i)); + } + return (limit, position) -> service.getModelPage(REGION, apiId, limit, position); + } + + private static Pager documentationParts(ApiGatewayService service) { + String apiId = newApi(service); + for (int i = 0; i < ITEMS; i++) { + service.createDocumentationPart(REGION, apiId, Map.of( + "location", Map.of("type", "MODEL", "name", "capped" + i), "properties", "{}")); + } + return (limit, position) -> + service.getDocumentationParts(REGION, apiId, null, null, null, null, limit, position); + } + + private static Pager basePathMappings(ApiGatewayService service) { + String apiId = newApi(service); + String domainName = "capped.example.com"; + service.createDomainName(REGION, Map.of("domainName", domainName, "endpointType", "REGIONAL")); + for (int i = 0; i < ITEMS; i++) { + service.createBasePathMapping(REGION, domainName, Map.of("basePath", "capped-" + i, "restApiId", apiId)); + } + return (limit, position) -> + service.getBasePathMappingsPage(REGION, domainName, String.valueOf(limit), position); + } + private static Pager vpcLinks(ApiGatewayService service) { for (int i = 0; i < ITEMS; i++) { service.createVpcLink(REGION, Map.of("name", "capped-" + i, @@ -129,6 +158,9 @@ class ApiGatewayPageCapTest { Named.of("GetUsagePlans", ApiGatewayPageCapTest::usagePlans), Named.of("GetUsagePlanKeys", ApiGatewayPageCapTest::usagePlanKeys), Named.of("GetRequestValidators", ApiGatewayPageCapTest::requestValidators), + Named.of("GetModels", ApiGatewayPageCapTest::models), + Named.of("GetDocumentationParts", ApiGatewayPageCapTest::documentationParts), + Named.of("GetBasePathMappings", ApiGatewayPageCapTest::basePathMappings), Named.of("GetVpcLinks", ApiGatewayPageCapTest::vpcLinks)); }