Skip to content

Commit

Permalink
tests for 235
Browse files Browse the repository at this point in the history
  • Loading branch information
CadeFaulkner authored and RustyHMCTS committed Mar 18, 2024
1 parent 1b7a1dc commit 81f5337
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ public void assertAddNotesForbidden() {
.statusCode(403);
}

@Then("the add notes request returns an Internal Server Error")
public void assertAddNotesInternalServerError() {
then().assertThat()
.statusCode(500);
}

@Then("the following account note is returned in the ac details request")
public void theFollowingAccountNoteIsReturnedInTheAcDetailsRequest(DataTable data) {
Map<String, String> response = data.asMap(String.class, String.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@PO-235 @Opal
Feature: tests for notes roles/permissions for accounts dependant on business units

Scenario: A user can add a note to a business unit it is part of
Given I am testing as the "[email protected]" user
When I make a request to the defendant account add notes api with
| associatedRecordId | 500000010 |
| businessUnitId | 17 |
| noteText | test roles and perms Opal user1 |
And the add notes response contains
| associatedRecordId | 500000010 |
| noteText | test roles and perms Opal user1 |
| postedBy | L017KG |
| postedByUserId | 500000000 |
| businessUnitId | 17 |


When I make a request to the defendant account add notes api with
| associatedRecordId | 500000010 |
| businessUnitId | 69 |
| noteText | test roles and perms Opal user1 |
And the add notes response contains
| associatedRecordId | 500000010 |
| noteText | test roles and perms Opal user1 |
| postedBy | L069KG |
| postedByUserId | 500000000 |
| businessUnitId | 69 |

Scenario: A user cannot add a note to a business unit it is not part of
Given I am testing as the "[email protected]" user
When I make a request to the defendant account add notes api with
| associatedRecordId | 500000010 |
| businessUnitId | 24 |
| noteText | test roles and perms Opal user1 |
Then the add notes request is forbidden

Scenario: The business unit must be defined in the request
Given I am testing as the "[email protected]" user
When I make a request to the defendant account add notes api with
| associatedRecordId | 500000010 |
| noteText | test roles and perms Opal user1 |
#When error logging is looked at would be good to check the error message
Then the add notes request returns an Internal Server Error

0 comments on commit 81f5337

Please sign in to comment.