fix: SQS tags set at CreateQueue not returned by ListQueueTags (#747)

Tags passed to CreateQueue were silently dropped in both the Query
and JSON protocol handlers — neither extracted the Tags parameter
before calling sqsService.createQueue().

Changes:
- SqsQueryHandler: extract Tag.N.Key/Value params and pass to service
- SqsJsonHandler: read both 'Tags' and 'tags' fields (botocore sends
  lowercase 'tags' for CreateQueue but uppercase 'Tags' for TagQueue)
- SqsService: add createQueue overload accepting tags; existing 2-arg
  and 3-arg overloads delegate with null tags (no callers broken)

Closes #699
This commit is contained in:
Dixit R Jain authored and GitHub committed 2026-05-08 17:17:36 -05:00
1 parent 3ae5c7b467
commit 1ffe905271
6 files changed
+101 -3

No files matched your search

@@ -250,6 +250,52 @@ class SqsIntegrationTest {
.statusCode(400);
}
@Test
void createQueue_withTags_tagsReturnedByListQueueTags() {
// Regression test for https://github.com/floci-io/floci/issues/699
// Tags supplied at CreateQueue time must be visible via ListQueueTags.
String taggedQueueName = "tagged-queue-integration-test";
// Extract the queue URL from the CreateQueue response — don't hard-code the port
String taggedQueueUrl = given()
.contentType("application/x-www-form-urlencoded")
.formParam("Action", "CreateQueue")
.formParam("QueueName", taggedQueueName)
.formParam("Tag.1.Key", "k1")
.formParam("Tag.1.Value", "v1")
.formParam("Tag.2.Key", "k2")
.formParam("Tag.2.Value", "v2")
.when()
.post("/")
.then()
.statusCode(200)
.body(containsString(taggedQueueName))
.extract().xmlPath().getString("CreateQueueResponse.CreateQueueResult.QueueUrl");
given()
.contentType("application/x-www-form-urlencoded")
.formParam("Action", "ListQueueTags")
.formParam("QueueUrl", taggedQueueUrl)
.when()
.post("/")
.then()
.statusCode(200)
.body(containsString("k1"))
.body(containsString("v1"))
.body(containsString("k2"))
.body(containsString("v2"));
// cleanup
given()
.contentType("application/x-www-form-urlencoded")
.formParam("Action", "DeleteQueue")
.formParam("QueueUrl", taggedQueueUrl)
.when()
.post("/")
.then()
.statusCode(200);
}
@Test
void unsupportedAction() {
given()
@@ -48,6 +48,20 @@ class SqsServiceTest {
assertEquals("60", queue.getAttributes().get("VisibilityTimeout"));
}
@Test
void createQueueWithTags_tagsReturnedByListQueueTags() {
// Regression test for https://github.com/floci-io/floci/issues/699
// Tags supplied at CreateQueue time must be visible via ListQueueTags.
Map<String, String> tags = Map.of("k1", "v1", "k2", "v2");
Queue queue = sqsService.createQueue("tagged-queue", null, tags, "us-east-1");
String queueUrl = queue.getQueueUrl();
Map<String, String> returned = sqsService.listQueueTags(queueUrl, "us-east-1");
assertEquals(2, returned.size(), "ListQueueTags must return all tags set during CreateQueue");
assertEquals("v1", returned.get("k1"));
assertEquals("v2", returned.get("k2"));
}
@Test
void deleteQueue() {
Queue queue = sqsService.createQueue("test-queue", null);