Unverified Commit 7bb6235a authored by Dan Jones's avatar Dan Jones
Browse files

test: add tests for 503 retries

parent dd29691a
......@@ -13,7 +13,7 @@ Feature: Can the adapter broadcast messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock notify API response is configured to return an error
When a mock notify API response is configured to return a 403 error
When the broadcast method is called
Then an error response is returned with status 403
......@@ -21,7 +21,7 @@ Feature: Can the adapter broadcast messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock notify API response is configured to return an error
When a mock notify API response is configured to return a 403 error
When the broadcast method is called
Then an error response is returned with status 403
Then the credentials are deleted
......@@ -32,8 +32,29 @@ Feature: Can the adapter broadcast messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock notify API response is configured to return an error
When a mock notify API response is configured to return a 403 error
When the broadcast method is called with is_retry on
Then an error response is returned with status 403
Then the credentials are deleted
Then the broadcast method is not called again
Scenario: On 503 the message is retried once with the same credentials
Given valid config
When the adapter instance is created
When the auth method is called
When a mock notify API response is configured to return a 503 error
When the broadcast method is called
Then an error response is returned with status 503
Then the credentials are not deleted
Then the broadcast method was called with is_retry on
Then the getAuthorizationHeader method is not called again
Scenario: On a retried 503 the message is not retried again
Given valid config
When the adapter instance is created
When the auth method is called
When a mock notify API response is configured to return a 503 error
When the broadcast method is called with is_retry on
Then an error response is returned with status 503
Then the credentials are not deleted
Then the broadcast method is not called again
......@@ -37,7 +37,7 @@ Feature: Can the adapter receive messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock receive API response is configured to return an error
When a mock receive API response is configured to return a 403 error
When the poll method is called
Then an error response is returned with status 403
......@@ -45,7 +45,7 @@ Feature: Can the adapter receive messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock receive API response is configured to return an error
When a mock receive API response is configured to return a 403 error
When the poll method is called
Then an error response is returned with status 403
Then the credentials are deleted
......@@ -56,8 +56,30 @@ Feature: Can the adapter receive messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock receive API response is configured to return an error
When a mock receive API response is configured to return a 403 error
When the poll method is called with is_retry on
Then an error response is returned with status 403
Then the credentials are deleted
Then the poll method is not called again
Scenario: On 503 the message is retried once with the same credentials
Given valid config
When the adapter instance is created
When the auth method is called
When a mock receive API response is configured to return a 503 error
When the poll method is called
Then an error response is returned with status 503
Then the credentials are not deleted
Then the poll method was called with is_retry on
Then the getAuthorizationHeader method is not called again
Scenario: On a retried 503 the message is not retried again
Given valid config
When the adapter instance is created
When the auth method is called
When a mock receive API response is configured to return a 503 error
When the poll method is called with is_retry on
Then an error response is returned with status 503
Then the credentials are not deleted
Then the poll method is not called again
\ No newline at end of file
......@@ -13,7 +13,7 @@ Feature: Can the adapter publish messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock send API response is configured to return an error
When a mock send API response is configured to return a 403 error
When the publish method is called
Then an error response is returned with status 403
......@@ -21,7 +21,7 @@ Feature: Can the adapter publish messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock send API response is configured to return an error
When a mock send API response is configured to return a 403 error
When the publish method is called
Then an error response is returned with status 403
Then the credentials are deleted
......@@ -32,8 +32,29 @@ Feature: Can the adapter publish messages?
Given valid config
When the adapter instance is created
When the auth method is called
When a mock send API response is configured to return an error
When a mock send API response is configured to return a 403 error
When the publish method is called with is_retry on
Then an error response is returned with status 403
Then the credentials are deleted
Then the publish method is not called again
Scenario: On 503 the message is retried once with new credentials
Given valid config
When the adapter instance is created
When the auth method is called
When a mock send API response is configured to return a 503 error
When the publish method is called
Then an error response is returned with status 503
Then the credentials are not deleted
Then the publish method was called with is_retry on
Then the getAuthorizationHeader method is not called again
Scenario: On a retried 503 the message is not retried again
Given valid config
When the adapter instance is created
When the auth method is called
When a mock send API response is configured to return a 503 error
When the publish method is called with is_retry on
Then an error response is returned with status 503
Then the credentials are not deleted
Then the publish method is not called again
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment