Light, fluffy, and always free - The AWS Local Emulator alternative
fix(elbv2): align DeleteTargetGroup with AWS Query response (#1194)
shrimptails-f701d8f4ae920
diff --git a/src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java b/src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.javaindex bd94b10688..cb4562cafa 100644--- a/src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java+++ b/src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java@@ -339,7 +339,8 @@ public class ElbV2QueryHandler {private Response handleDeleteTargetGroup(MultivaluedMap<String, String> p, String region) {String arn = p.getFirst("TargetGroupArn");service.deleteTargetGroup(region, arn);- return voidResponse("DeleteTargetGroupResponse");+ String xml = AwsQueryResponse.envelopeEmptyResult("DeleteTargetGroup", AwsNamespaces.ELB_V2);+ return Response.ok(xml).type(MediaType.APPLICATION_XML).build();}private Response handleModifyTargetGroup(MultivaluedMap<String, String> p, String region) {diff --git a/src/test/java/io/github/hectorvent/floci/services/elbv2/ElbV2IntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/elbv2/ElbV2IntegrationTest.javaindex 90b3bb72a1..90bf2c685c 100644--- a/src/test/java/io/github/hectorvent/floci/services/elbv2/ElbV2IntegrationTest.java+++ b/src/test/java/io/github/hectorvent/floci/services/elbv2/ElbV2IntegrationTest.java@@ -662,6 +662,21 @@ class ElbV2IntegrationTest {@Test@Order(72)+ void deleteTargetGroupIncludesEmptyResult() {+ given()+ .formParam("Action", "DeleteTargetGroup")+ .formParam("TargetGroupArn", tgArn)+ .header("Authorization", AUTH)+ .when()+ .post("/")+ .then()+ .statusCode(200)+ .body(containsString("<DeleteTargetGroupResult"))+ .body("DeleteTargetGroupResponse.ResponseMetadata.RequestId", not(isEmptyOrNullString()));+ }++ @Test+ @Order(73)void deleteLoadBalancerCascades() {given().formParam("Action", "DeleteLoadBalancer")