fix(sqs): drop uppercase "Tags" read from CreateQueue JSON handler (#752)

* fix(sqs): drop uppercase "Tags" read from CreateQueue JSON handler

AWS SQS JSON 1.0 schema uses lowercase "tags" for CreateQueue (uppercase
"Tags" is reserved for TagQueue). Real AWS treats unknown JSON fields as
ignored, so a hand-crafted client sending uppercase "Tags" would lose its
tags on AWS — but floci silently persisted them, diverging from AWS
behavior and masking client bugs at migration time.

Drop the defensive uppercase merge and add JSON-protocol integration
tests for both the canonical lowercase path (tags persist) and the
uppercase-as-unknown-field path (tags ignored).

* test(sqs): wrap CreateQueue-with-tags tests in try/finally for cleanup

Wrap CreateQueue + ListQueueTags + DeleteQueue test bodies so the
cleanup DeleteQueue runs in a finally block. A failed assertion
previously left an orphan queue, which could mask flake under re-runs
since CreateQueue is idempotent and won't re-apply tags to an existing
queue.
This commit is contained in:
Kenshin Okinaka authored and GitHub committed 2026-05-09 00:32:49 -05:00
1 parent 15c9f58aae
commit 7a036fdf59
2 files changed
+90 -18

No files matched your search

@@ -66,10 +66,7 @@ public class SqsJsonHandler {
private Response handleCreateQueue(JsonNode request, String region) {
String queueName = request.path("QueueName").asText(null);
Map<String, String> attributes = jsonNodeToMap(request.path("Attributes"));
// Botocore sends "tags" (lowercase) for CreateQueue but "Tags" (uppercase) for TagQueue.
// Merge both to handle any client regardless of casing.
Map<String, String> tags = new HashMap<>(jsonNodeToMap(request.path("Tags")));
tags.putAll(jsonNodeToMap(request.path("tags")));
Map<String, String> tags = jsonNodeToMap(request.path("tags"));
Queue queue = sqsService.createQueue(queueName, attributes, tags, region);
ObjectNode response = objectMapper.createObjectNode();