mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(sqs): support binary message attributes and fix MD5OfMessageAttributes (#168)
This commit is contained in:
1 parent
7253559207
commit
5440ae8a55
5 files changed
+107
-21
No files matched your search
@@ -64,6 +64,7 @@ class SqsIntegrationTest {
|
||||
@Test
|
||||
@Order(4)
|
||||
void sendMessage() {
|
||||
// MD5 of "Hello from integration test!" = 72077a684c89bfbf51991620feedff61
|
||||
given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.formParam("Action", "SendMessage")
|
||||
@@ -74,7 +75,7 @@ class SqsIntegrationTest {
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<MessageId>"))
|
||||
.body(containsString("<MD5OfMessageBody>"));
|
||||
.body(containsString("<MD5OfMessageBody>72077a684c89bfbf51991620feedff61</MD5OfMessageBody>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -170,6 +171,48 @@ class SqsIntegrationTest {
|
||||
|
||||
@Test
|
||||
@Order(9)
|
||||
void sendMessageWithStringAttribute() {
|
||||
// MD5 of body "attr-test" = 6eee3c38f0022ec400be5d6eb6f22709
|
||||
// MD5 of attributes {color=red (String)} = 20ca9041878c8c65d5a4bf6eaf446c21
|
||||
given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.formParam("Action", "SendMessage")
|
||||
.formParam("QueueUrl", queueUrl)
|
||||
.formParam("MessageBody", "attr-test")
|
||||
.formParam("MessageAttribute.1.Name", "color")
|
||||
.formParam("MessageAttribute.1.Value.DataType", "String")
|
||||
.formParam("MessageAttribute.1.Value.StringValue", "red")
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<MD5OfMessageBody>6eee3c38f0022ec400be5d6eb6f22709</MD5OfMessageBody>"))
|
||||
.body(containsString("<MD5OfMessageAttributes>20ca9041878c8c65d5a4bf6eaf446c21</MD5OfMessageAttributes>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
void sendMessageWithBinaryAttribute() {
|
||||
// body "binary-attr-test" MD5 = c090a04ce0c88aea830b4bf78051e834
|
||||
// attribute data=bytes[1,2,3] (Binary), base64=AQID
|
||||
// MD5 of attributes {data=[1,2,3] (Binary)} = 922637243eb93fabf39f19417c7e2b43
|
||||
given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.formParam("Action", "SendMessage")
|
||||
.formParam("QueueUrl", queueUrl)
|
||||
.formParam("MessageBody", "binary-attr-test")
|
||||
.formParam("MessageAttribute.1.Name", "data")
|
||||
.formParam("MessageAttribute.1.Value.DataType", "Binary")
|
||||
.formParam("MessageAttribute.1.Value.BinaryValue", "AQID")
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<MD5OfMessageAttributes>922637243eb93fabf39f19417c7e2b43</MD5OfMessageAttributes>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(11)
|
||||
void getQueueAttributes() {
|
||||
given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
@@ -185,7 +228,7 @@ class SqsIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
@Order(12)
|
||||
void deleteQueue() {
|
||||
given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
|
||||
Reference in new issue
Block a user