Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
backbone-adapter-testsuite
Commits
7bb6235a
Unverified
Commit
7bb6235a
authored
2 years ago
by
Dan Jones
Browse files
Options
Download
Email Patches
Plain Diff
test: add tests for 503 retries
parent
dd29691a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
9 deletions
+73
-9
features/adapter_broadcast.feature
features/adapter_broadcast.feature
+24
-3
features/adapter_poll.feature
features/adapter_poll.feature
+25
-3
features/adapter_publish.feature
features/adapter_publish.feature
+24
-3
No files found.
features/adapter_broadcast.feature
View file @
7bb6235a
...
...
@@ -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 a
n
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 a
n
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 a
n
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
This diff is collapsed.
Click to expand it.
features/adapter_poll.feature
View file @
7bb6235a
...
...
@@ -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 a
n
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 a
n
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 a
n
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
This diff is collapsed.
Click to expand it.
features/adapter_publish.feature
View file @
7bb6235a
...
...
@@ -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 a
n
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 a
n
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 a
n
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
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment