-
Notifications
You must be signed in to change notification settings - Fork 40
/
sqs.feature
56 lines (52 loc) · 2.28 KB
/
sqs.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@sqs
Feature: SQS Integration
# Requires fake sqs: docker run -d -p 9324:9324 s12v/elasticmq
Background:
Given AWS SNS client
And AWS SQS client
And I purge queue "http://localhost:9324?QueueName=queue1"
Scenario: Publish
Given I create a new topic "test1"
And I subscribe endpoint "file://tmp?fileName=sns.log" with protocol "file" to topic "test1"
And I subscribe endpoint "aws-sqs://queue1?amazonSQSEndpoint=http://localhost:9324&accessKey=&secretKey=" with protocol "sqs" to topic "test1"
When I publish a message "Hello, World!" to topic "test1"
Then The publish request should be successful
Then I wait for 1 seconds
Then I should see "Hello, World!" in file "./tmp/sns.log"
Then I should see "Hello, World!" in queue "http://localhost:9324?QueueName=queue1"
Scenario: Raw Message Delivery
Given I create a new topic "test2"
And I subscribe endpoint "aws-sqs://queue1?amazonSQSEndpoint=http://localhost:9324&accessKey=&secretKey=" with protocol "sqs" to topic "test2" as "subscription"
And I set "RawMessageDelivery" for "subscription" to "true"
When I publish a message to topic "test2":
"""
{
"hello, world!": true
}
"""
Then The publish request should be successful
Then I wait for 1 seconds
And I get the message in queue "http://localhost:9324?QueueName=queue1"
Then the message body should be:
"""
{
"hello, world!": true
}
"""
Scenario: Message Attributes
Given I create a new topic "test3"
And I subscribe endpoint "aws-sqs://queue1?amazonSQSEndpoint=http://localhost:9324&accessKey=&secretKey=" with protocol "sqs" to topic "test3" as "subscription"
And I set "RawMessageDelivery" for "subscription" to "true"
When I publish "Hello, World!" to topic "test3" with attributes:
| Name | Data Type | String Value |
| Trace-Id | String | 123456 |
| Logging-Id | String | EFGADBC |
Then The publish request should be successful
And I wait for 1 seconds
And I get the message in queue "http://localhost:9324?QueueName=queue1"
Then the message body should be:
"""
Hello, World!
"""
And the message attribute "Trace-Id" should be "123456"
And the message attribute "Logging-Id" should be "EFGADBC"