Skip to content

Commit

Permalink
feat: fix use of hard-coded credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-garciad committed Nov 2, 2023
1 parent 52ca2a1 commit 8fd2e22
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 107 deletions.
4 changes: 3 additions & 1 deletion test/acceptance/environments/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ dot: tls://dns.google:853
timeout: 2000

# RabbitMQ settings
rabbitmq: amqp://guest:guest@localhost:5672/
rabbitmqSchema: amqp://
rabbitmqCredentials: guest:guest
rabbitmqHost: "@localhost:5672/"

# JWT settings
signSymmetricKey: sign_symmetric_key_that_is_long_enough_for_algorithm_HS512_(with_more_than 256 bits!)
Expand Down
4 changes: 3 additions & 1 deletion test/acceptance/environments/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ dot: tls://dns.google:853
timeout: 2000

# RabbitMQ settings
rabbitmq: amqp://guest:guest@rabbit:5672/
rabbitmqSchema: amqp://
rabbitmqCredentials: guest:guest
rabbitmqHost: "@rabbit:5672/"

# JWT settings
signSymmetricKey: sign_symmetric_key_that_is_long_enough_for_algorithm_HS512_(with_more_than 256 bits!)
Expand Down
210 changes: 105 additions & 105 deletions test/acceptance/features/rabbit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,139 +2,139 @@ Feature: Rabbit client

@rabbit
Scenario: Publish and subscribe a text message
Given the rabbit endpoint "[CONF:rabbitmq]"
And I subscribe to the rabbit topic "test-rabbit-text-properties-topic"
When I publish a message to the rabbit topic "test-rabbit-text-properties-topic" with the text
Given the rabbit endpoint "[CONF:rabbitmqSchema][CONF:rabbitmqCredentials][CONF:rabbitmqHost]"
And I subscribe to the rabbit topic "test-rabbit-text-properties-topic"
When I publish a message to the rabbit topic "test-rabbit-text-properties-topic" with the text
"""
This is a test message
"""
Then I wait up to "3" seconds for a rabbit message with the text
Then I wait up to "3" seconds for a rabbit message with the text
"""
This is a test message
"""

@rabbit
Scenario: Publish and subscribe a JSON message
Given the rabbit endpoint "[CONF:rabbitmq]"
And I subscribe to the rabbit topic "test-rabbit-json-properties-topic"
And I set standard rabbit properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
When I publish a message to the rabbit topic "test-rabbit-json-properties-topic" with the JSON properties
| param | value |
| id | abc |
| name | Golium |
Then I wait up to "3" seconds for a rabbit message with the JSON properties
| param | value |
| id | abc |
| name | Golium |
Given the rabbit endpoint "[CONF:rabbitmqSchema][CONF:rabbitmqCredentials][CONF:rabbitmqHost]"
And I subscribe to the rabbit topic "test-rabbit-json-properties-topic"
And I set standard rabbit properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
When I publish a message to the rabbit topic "test-rabbit-json-properties-topic" with the JSON properties
| param | value |
| id | abc |
| name | Golium |
Then I wait up to "3" seconds for a rabbit message with the JSON properties
| param | value |
| id | abc |
| name | Golium |

@rabbit
Scenario: Publish and subscribe a JSON message. Use standard properties
Given I generate a UUID and store it in context "CorrelationId"
Given the rabbit endpoint "[CONF:rabbitmq]"
And I subscribe to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]"
And I set standard rabbit properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id | abc |
| name | Golium |
Then I wait up to "3" seconds for a rabbit message with the standard properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
And the rabbit message body has the JSON properties
| param | value |
| id | abc |
| name | Golium |
Given the rabbit endpoint "[CONF:rabbitmqSchema][CONF:rabbitmqCredentials][CONF:rabbitmqHost]"
And I subscribe to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]"
And I set standard rabbit properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id | abc |
| name | Golium |
Then I wait up to "3" seconds for a rabbit message with the standard properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
And the rabbit message body has the JSON properties
| param | value |
| id | abc |
| name | Golium |

@rabbit
Scenario: Publish and subscribe three JSON messages. Use standard properties
Given I generate a UUID and store it in context "CorrelationId"
Given the rabbit endpoint "[CONF:rabbitmq]"
And I subscribe to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]"
And I set standard rabbit properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id0 | abc0 |
| name0 | Golium0 |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id1 | abc1 |
| name1 | Golium1 |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id2 | abc2 |
| name2 | Golium2 |
Then I wait up to "5" seconds for exactly "3" rabbit messages with the standard properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
And the body of the rabbit message in position "0" has the JSON properties
| param | value |
| id0 | abc0 |
| name0 | Golium0 |
And the body of the rabbit message in position "1" has the JSON properties
| param | value |
| id1 | abc1 |
| name1 | Golium1 |
And the body of the rabbit message in position "2" has the JSON properties
| param | value |
| id2 | abc2 |
| name2 | Golium2 |
Given the rabbit endpoint "[CONF:rabbitmqSchema][CONF:rabbitmqCredentials][CONF:rabbitmqHost]"
And I subscribe to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]"
And I set standard rabbit properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id0 | abc0 |
| name0 | Golium0 |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id1 | abc1 |
| name1 | Golium1 |
When I publish a message to the rabbit topic "test-rabbit-json-properties-[CTXT:CorrelationId]" with the JSON properties
| param | value |
| id2 | abc2 |
| name2 | Golium2 |
Then I wait up to "5" seconds for exactly "3" rabbit messages with the standard properties
| param | value |
| ContentType | application/json |
| CorrelationId | [CTXT:CorrelationId] |
And the body of the rabbit message in position "0" has the JSON properties
| param | value |
| id0 | abc0 |
| name0 | Golium0 |
And the body of the rabbit message in position "1" has the JSON properties
| param | value |
| id1 | abc1 |
| name1 | Golium1 |
And the body of the rabbit message in position "2" has the JSON properties
| param | value |
| id2 | abc2 |
| name2 | Golium2 |

@rabbit
Scenario: Publish and subscribe a JSON message with rabbit headers and standard properties
Given the rabbit endpoint "[CONF:rabbitmq]"
And I subscribe to the rabbit topic "test-rabbit-headers-properties-topic"
And I set rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |
When I publish a message to the rabbit topic "test-rabbit-headers-properties-topic" with the JSON properties
| param | value |
| id | abc |
| name | Golium |
Then I wait up to "3" seconds for a rabbit message with the JSON properties
| param | value |
| id | abc |
| name | Golium |
And the rabbit message has the rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |
Given the rabbit endpoint "[CONF:rabbitmqSchema][CONF:rabbitmqCredentials][CONF:rabbitmqHost]"
And I subscribe to the rabbit topic "test-rabbit-headers-properties-topic"
And I set rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |
When I publish a message to the rabbit topic "test-rabbit-headers-properties-topic" with the JSON properties
| param | value |
| id | abc |
| name | Golium |
Then I wait up to "3" seconds for a rabbit message with the JSON properties
| param | value |
| id | abc |
| name | Golium |
And the rabbit message has the rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |

@rabbit
Scenario: Publish and subscribe a text message with rabbit headers
Given the rabbit endpoint "[CONF:rabbitmq]"
And I subscribe to the rabbit topic "test-rabbit-headers-topic"
And I set rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |
When I publish a message to the rabbit topic "test-rabbit-headers-topic" with the text
Given the rabbit endpoint "[CONF:rabbitmqSchema][CONF:rabbitmqCredentials][CONF:rabbitmqHost]"
And I subscribe to the rabbit topic "test-rabbit-headers-topic"
And I set rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |
When I publish a message to the rabbit topic "test-rabbit-headers-topic" with the text
"""
"""
Then I wait up to "3" seconds for a rabbit message with the text
Then I wait up to "3" seconds for a rabbit message with the text
"""
"""
And the rabbit message has the rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |
And the rabbit message has the rabbit headers
| param | value |
| Header1 | value1 |
| Header2 | value2 |

@rabbit
Scenario: Subscribe and waits for no message
Given I generate a UUID and store it in context "CorrelationId"
Given the rabbit endpoint "[CONF:rabbitmq]"
When I subscribe to the rabbit topic "test-rabbit-empty-topic"
Then I wait up to "3" seconds without a rabbit message with the standard properties
| param | value |
| CorrelationId | [CTXT:CorrelationId] |
Given the rabbit endpoint "[CONF:rabbitmqSchema][CONF:rabbitmqCredentials][CONF:rabbitmqHost]"
When I subscribe to the rabbit topic "test-rabbit-empty-topic"
Then I wait up to "3" seconds without a rabbit message with the standard properties
| param | value |
| CorrelationId | [CTXT:CorrelationId] |

0 comments on commit 8fd2e22

Please sign in to comment.