generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tests_for_PO-749
- Loading branch information
Showing
2 changed files
with
145 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...palMode/manualAccountCreation/draftAccounts/PO-747_patchDraftAccountErrorHandling.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
@Opal | ||
Feature: PO-747 patch draft account error handling | ||
|
||
@PO-747 @cleanUpData | ||
Scenario: Patch draft account - CEP1 - Invalid Request Payload | ||
Given I am testing as the "opal-test@hmcts.net" user | ||
When I create a draft account with the following details | ||
| business_unit_id | 73 | | ||
| account | draftAccounts/accountJson/account.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID | | ||
| timeline_data | | | ||
Then The draft account response returns 201 | ||
And I store the created draft account ID | ||
|
||
When I patch the draft account with the following details | ||
| business_unit_id__ | 73 | | ||
| account_status | Rejected | | ||
| validated_by | BUUID_REVIEWER | | ||
| reason_text | Reason for rejection | | ||
Then The draft account response returns 400 | ||
|
||
@PO-747 @cleanUpData | ||
Scenario: Patch draft account - CEP2 - Invalid or No Access Token | ||
Given I am testing as the "opal-test@hmcts.net" user | ||
When I create a draft account with the following details | ||
| business_unit_id | 73 | | ||
| account | draftAccounts/accountJson/account.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID | | ||
| timeline_data | | | ||
Then The draft account response returns 201 | ||
And I store the created draft account ID | ||
|
||
When I set an invalid token | ||
And I patch the draft account with the following details | ||
| business_unit_id | 73 | | ||
| account_status | Rejected | | ||
| validated_by | BUUID_REVIEWER | | ||
| reason_text | Reason for rejection | | ||
Then The draft account response returns 401 | ||
|
||
Then I am testing as the "opal-test@hmcts.net" user | ||
|
||
@PO-747 @cleanUpData | ||
Scenario: Patch draft account - CEP4 - Resource Not Found | ||
Given I am testing as the "opal-test@hmcts.net" user | ||
When I patch the "1000000000" draft account with the following details | ||
| business_unit_id | 73 | | ||
| account_status | Rejected | | ||
| validated_by | BUUID_REVIEWER | | ||
| reason_text | Reason for rejection | | ||
Then The draft account response returns 404 | ||
|
||
@PO-747 @cleanUpData | ||
Scenario: Patch draft account - CEP5 - Unsupported Content Type | ||
Given I am testing as the "opal-test@hmcts.net" user | ||
When I attempt to patch a draft account with an unsupported content type | ||
Then The draft account response returns 406 | ||
|
||
@PO-747 @cleanUpData | ||
Scenario: Patch draft account - CEP7 - Unsupported Media Type | ||
Given I am testing as the "opal-test@hmcts.net" user | ||
When I attempt to patch a draft account with an unsupported media type | ||
Then The draft account response returns 415 | ||
|
||
@PO-747 @cleanUpData | ||
Scenario: Patch draft account - CEP9 - Other Server Error | ||
Given I am testing as the "opal-test@hmcts.net" user | ||
When I patch the draft account trying to provoke an internal server error | ||
Then The draft account response returns 500 |