diff --git a/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java b/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java index 7978fe652a..960b1f7798 100644 --- a/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java +++ b/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java @@ -7524,11 +7524,10 @@ public class RdsService implements Resettable, ResourceProvider { public Collection listDbParameterGroups( String filterName, String region) { - String effectiveRegion = effectiveRegion(region); if (filterName != null && !filterName.isBlank()) { - DbParameterGroup group = findParameterGroupForRegion(filterName, effectiveRegion); - return group != null ? List.of(group) : List.of(); + return List.of(getDbParameterGroup(filterName, region)); } + String effectiveRegion = effectiveRegion(region); Map unique = new LinkedHashMap<>(); List storedGroups; if (parameterGroups instanceof AccountAwareStorageBackend aware) { diff --git a/src/test/java/io/github/hectorvent/floci/services/rds/RdsParameterGroupTagIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/rds/RdsParameterGroupTagIntegrationTest.java index 2beecaeb9b..24a69a8081 100644 --- a/src/test/java/io/github/hectorvent/floci/services/rds/RdsParameterGroupTagIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/rds/RdsParameterGroupTagIntegrationTest.java @@ -10,6 +10,7 @@ import org.junit.jupiter.api.TestMethodOrder; import static io.restassured.RestAssured.given; import static io.restassured.http.ContentType.URLENC; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; /** @@ -64,6 +65,26 @@ class RdsParameterGroupTagIntegrationTest { .body(containsString("data")); } + @Test + @Order(2) + void describingAnUnknownParameterGroupIsNotFoundButAKnownOneIsReturned() { + query("DescribeDBParameterGroups") + .formParam("DBParameterGroupName", "no-such-pg") + .when().post("/") + .then() + .statusCode(404) + .body(containsString("DBParameterGroupNotFound")) + .body("ErrorResponse.Error.Message", + equalTo("DBParameterGroupName doesn't refer to an existing DB parameter group.")); + + query("DescribeDBParameterGroups") + .formParam("DBParameterGroupName", PG) + .when().post("/") + .then() + .statusCode(200) + .body(containsString("" + PG + "")); + } + @Test @Order(1) void aClusterParameterGroupIsTaggableTheSameWay() {