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.
* tests for PO-830 * updated tests for PO-830
- Loading branch information
1 parent
7da2c60
commit aa96a86
Showing
1 changed file
with
206 additions
and
0 deletions.
There are no files selected for viewing
206 changes: 206 additions & 0 deletions
206
.../opalMode/manualAccountCreation/draftAccounts/PO-830_putDraftAccountAuthorisation.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,206 @@ | ||
@Opal | ||
Feature: PO-830 - Authorisation for put/update draft account | ||
|
||
@PO-830 @cleanUpData | ||
Scenario: Update draft account - no auth | ||
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 update the draft account that was just created with the following details | ||
| business_unit_id | 73 | | ||
| account | draftAccounts/accountJson/adultAccount.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID_Updated | | ||
| timeline_data | | | ||
Then The draft account response returns 401 | ||
|
||
Then I am testing as the "opal-test@hmcts.net" user | ||
|
||
@PO-830 @cleanUpData | ||
Scenario: Update draft account - user with no permissions | ||
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 | | | ||
And I store the created draft account ID | ||
Then The draft account response returns 201 | ||
|
||
When I am testing as the "opal-test-2@hmcts.net" user | ||
And I update the draft account that was just created with the following details | ||
| business_unit_id | 73 | | ||
| account | draftAccounts/accountJson/adultAccount.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID_Updated | | ||
| timeline_data | | | ||
Then The draft account response returns 403 | ||
|
||
When I am testing as the "opal-test@hmcts.net" user | ||
And I get the single created draft account and the response contains | ||
| business_unit_id | 73 | | ||
| account_type | Fine | | ||
| account_status | Submitted | | ||
| account_snapshot.defendant_name | null, null | | ||
| account_snapshot.date_of_birth | | | ||
| account_snapshot.account_type | | | ||
| account_snapshot.submitted_by | BUUID | | ||
| account_snapshot.business_unit_name | West London | | ||
|
||
Then I delete the created draft accounts | ||
|
||
@PO-830 @cleanUpData | ||
Scenario: Update draft account - user with permissions in different business unit - bu 73 to 26 | ||
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 | | | ||
And I store the created draft account ID | ||
Then The draft account response returns 201 | ||
|
||
When I am testing as the "opal-test-3@hmcts.net" user | ||
And I update the draft account that was just created with the following details | ||
| business_unit_id | 73 | | ||
| account | draftAccounts/accountJson/adultAccount.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID_Updated | | ||
| timeline_data | | | ||
Then The draft account response returns 403 | ||
|
||
When I am testing as the "opal-test@hmcts.net" user | ||
And I get the single created draft account and the response contains | ||
| business_unit_id | 73 | | ||
| account_type | Fine | | ||
| account_status | Submitted | | ||
| account_snapshot.defendant_name | null, null | | ||
| account_snapshot.date_of_birth | | | ||
| account_snapshot.account_type | | | ||
| account_snapshot.submitted_by | BUUID | | ||
| account_snapshot.business_unit_name | West London | | ||
|
||
Then I delete the created draft accounts | ||
|
||
@PO-830 @cleanUpData | ||
Scenario: Update draft account - user with permissions in different business unit - bu 26 to 73 | ||
Given I am testing as the "opal-test-3@hmcts.net" user | ||
When I create a draft account with the following details | ||
| business_unit_id | 26 | | ||
| account | draftAccounts/accountJson/account.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID | | ||
| timeline_data | | | ||
And I store the created draft account ID | ||
Then The draft account response returns 201 | ||
|
||
When I am testing as the "opal-test@hmcts.net" user | ||
And I update the draft account that was just created with the following details | ||
| business_unit_id | 26 | | ||
| account | draftAccounts/accountJson/adultAccount.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID_Updated | | ||
| timeline_data | | | ||
Then The draft account response returns 403 | ||
|
||
When I am testing as the "opal-test-3@hmcts.net" user | ||
And I get the single created draft account and the response contains | ||
| business_unit_id | 26 | | ||
| account_type | Fine | | ||
| account_status | Submitted | | ||
| account_snapshot.defendant_name | null, null | | ||
| account_snapshot.date_of_birth | | | ||
| account_snapshot.account_type | | | ||
| account_snapshot.submitted_by | BUUID | | ||
| account_snapshot.business_unit_name | Hertfordshire | | ||
|
||
Then I delete the created draft accounts | ||
|
||
@PO-830 @cleanUpData | ||
Scenario: Update draft account - user with permissions in same business unit | ||
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 | | | ||
And I store the created draft account ID | ||
Then The draft account response returns 201 | ||
|
||
When I update the draft account that was just created with the following details | ||
| business_unit_id | 73 | | ||
| account | draftAccounts/accountJson/adultAccount.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID_Updated | | ||
| timeline_data | | | ||
Then The draft account response returns 200 | ||
|
||
And I get the single created draft account and the response contains | ||
| business_unit_id | 73 | | ||
| account_type | Fine | | ||
| account_status | Resubmitted | | ||
| account_snapshot.defendant_name | LNAME, FNAME | | ||
| account_snapshot.date_of_birth | 01/01/2000 | | ||
| account_snapshot.account_type | Fine | | ||
| account_snapshot.submitted_by | BUUID_Updated | | ||
| account_snapshot.business_unit_name | West London | | ||
|
||
Then I delete the created draft accounts | ||
|
||
@PO-830 @cleanUpData | ||
Scenario: Update draft account - user with permissions in same business unit - updating business unit | ||
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 | | | ||
And I store the created draft account ID | ||
Then The draft account response returns 201 | ||
|
||
When I update the draft account that was just created with the following details | ||
| business_unit_id | 77 | | ||
| account | draftAccounts/accountJson/adultAccount.json | | ||
| account_type | Fine | | ||
| account_status | | | ||
| submitted_by | BUUID_Updated | | ||
| timeline_data | | | ||
Then The draft account response returns 409 | ||
|
||
And I get the single created draft account and the response contains | ||
| business_unit_id | 73 | | ||
| account_type | Fine | | ||
| account_status | Submitted | | ||
| account_snapshot.defendant_name | null, null | | ||
| account_snapshot.date_of_birth | | | ||
| account_snapshot.account_type | | | ||
| account_snapshot.submitted_by | BUUID | | ||
| account_snapshot.business_unit_name | West London | | ||
|
||
Then I delete the created draft accounts | ||
|
||
|
||
|