Feature: Can the adapter publish messages? The adapter publish method works as expected Scenario: A message can be published successfully 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 success When the publish method is called Then a successful response is returned with status 200 Scenario: A failed publish returns a 403 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 403 error When the publish method is called Then an error response is returned with status 403 Scenario: On 403 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 403 error When the publish method is called Then an error response is returned with status 403 Then the credentials are deleted Then the publish method was called with is_retry on Then the total number of calls to "publish" was 2 Then the total number of calls to "getAuthorizationHeader" was 2 Scenario: On a retried 403 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 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 total number of calls to "publish" was 1 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 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 total number of calls to "publish" was 2 Then the total number of calls to "getAuthorizationHeader" was 1 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 total number of calls to "publish" was 1