generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DTSAM-574 add optional roleLabel in RAS query APIs response (#2355)
* DTSAM-574 add optional roleLabel in RAS query APIs response * DTSAM-574 add sonar issue + tidy up * DTSAM-574 fetch `RoleConfig` outside forEach & null check `RoleConfigRole` * DTSAM-574 revert JacksonUtils.java changes * DTSAM-574 update IT * DTSAM-574 update `RoleAssignmentIntegrationTest.java` imports * DTSAM-574 review feedback (move duplicate code to method) * DTSAM-574 FTA added scenario for v1 & 2 query req with includeLabels (#2359) * DTSAM-574 FTA added scenario for v1 query req with includeLabels * DTSAM-574 FTA added scenario for v2 query req with includeLabels * DTSAM-574 update S-185 FTA * DTSAM-574 update S-185 FTA * DTSAM-574 update S-185 FTA * DTSAM-574 add `__ordering__` & `__elementId__` S-185 FTA * DTSAM-574 update S-185 * DTSAM-574 delete RoleAssignments for s-185 * DTSAM-574 review feedback (generate UUID for reference) * DTSAM-583 Fix non-running integration tests (#2361) [DTSAM-583](https://tools.hmcts.net/jira/browse/DTSAM-583) Fix non-running integration tests. --------- Co-authored-by: Matt Nayler <57350764+mattnayler@users.noreply.github.com>
- Loading branch information
1 parent
a3c5919
commit 9baaef1
Showing
15 changed files
with
677 additions
and
152 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
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
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,30 @@ | ||
{ | ||
"title": "must successfully receive Role Assignments including role label with one query param", | ||
"_guid_": "S-088", | ||
"_extends_": "F-006_Test_Data_Base", | ||
"specs": [ | ||
"contains one search query param", | ||
"has includeLabels request param set to true" | ||
], | ||
|
||
"request": { | ||
"queryParams": { | ||
"includeLabels": "true" | ||
}, | ||
"body": { | ||
"actorId": ["${[scenarioContext][childContexts][CreationDataForRoleAssignment][testData][request][body][roleRequest][reference]}"] | ||
} | ||
}, | ||
"expectedResponse": { | ||
"_extends_": "Common_200_Response", | ||
"body": { | ||
"roleAssignmentResponse" : [ | ||
{ | ||
"_extends_": "ResponseRoleAssignment", | ||
"actorId": "${}${[scenarioContext][testData][request][body][actorId][0]}", | ||
"roleLabel": "Judge" | ||
} | ||
] | ||
} | ||
} | ||
} |
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
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,54 @@ | ||
{ | ||
"title": "must successfully receive Role Assignments with page size including role label", | ||
"_guid_": "S-185", | ||
"_extends_": "F-009_Test_Data_Base", | ||
"specs": [ | ||
"contains multiple Role Assignments with a page size", | ||
"has includeLabels request param set to true" | ||
], | ||
|
||
"request": { | ||
"headers": { | ||
"size": 3, | ||
"sort": "roleName" | ||
}, | ||
"queryParams": { | ||
"includeLabels": "true" | ||
}, | ||
"body": { | ||
"queryRequests":[ | ||
{ | ||
"actorId": ["${[scenarioContext][childContexts][S-185_CreationDataForRoleAssignment][testData][request][body][roleRequest][reference]}"] | ||
} | ||
] | ||
} | ||
}, | ||
"expectedResponse": { | ||
"_extends_": "Common_200_Response", | ||
"body": { | ||
"roleAssignmentResponse" : [ | ||
{ | ||
"_extends_": "ResponseRoleAssignment", | ||
"actorId": "${}${[scenarioContext][testData][request][body][queryRequests][0][actorId][0]}", | ||
"roleName": "case-allocator", | ||
"roleLabel": "Case Allocator", | ||
"attributes" : { | ||
"substantive": "N" | ||
} | ||
}, | ||
{ | ||
"_extends_": "ResponseRoleAssignment", | ||
"actorId": "${}${[scenarioContext][testData][request][body][queryRequests][0][actorId][0]}", | ||
"roleName": "judge", | ||
"roleLabel": "Judge" | ||
}, | ||
{ | ||
"_extends_": "ResponseRoleAssignment", | ||
"actorId": "${}${[scenarioContext][testData][request][body][queryRequests][0][actorId][0]}", | ||
"roleName": "senior-judge", | ||
"roleLabel": "Senior Judge" | ||
} | ||
] | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
src/functionalTest/resources/features/F-009/S-185_CreationDataForRoleAssignment.td.json
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,66 @@ | ||
{ | ||
"_guid_": "S-185_CreationDataForRoleAssignment", | ||
"_extends_": "CreationDataBaseForRoleAssignment", | ||
"request": { | ||
"body": { | ||
"roleRequest": { | ||
"reference": "${[scenarioContext][customValues][generateUUID]}", | ||
"replaceExisting": true | ||
}, | ||
"requestedRoles": [ | ||
{ | ||
"_extends_": "RequestedRole", | ||
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"roleName": "case-allocator" | ||
}, | ||
{ | ||
"_extends_": "RequestedRole", | ||
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"roleName": "judge" | ||
}, | ||
{ | ||
"_extends_": "RequestedRole", | ||
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"roleName": "senior-judge" | ||
} | ||
] | ||
} | ||
}, | ||
"expectedResponse": { | ||
"body": { | ||
"roleAssignmentResponse": { | ||
"roleRequest": { | ||
"reference": "${}${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"replaceExisting": true | ||
}, | ||
"requestedRoles": [ | ||
{ | ||
"__ordering__": "UNORDERED", | ||
"__elementId__": "roleName" | ||
}, | ||
{ | ||
"_extends_": "ResponseRequestedRole", | ||
"actorId": "${}${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"reference": "${}${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"roleName": "case-allocator", | ||
"attributes" : { | ||
"substantive": "N" | ||
} | ||
}, | ||
{ | ||
"_extends_": "ResponseRequestedRole", | ||
"actorId": "${}${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"reference": "${}${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"roleName": "judge" | ||
}, | ||
{ | ||
"_extends_": "ResponseRequestedRole", | ||
"actorId": "${}${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"reference": "${}${[scenarioContext][testData][request][body][roleRequest][reference]}", | ||
"roleName": "senior-judge" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...unctionalTest/resources/features/F-009/S-185_DeleteDataForMultipleRoleAssignments.td.json
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,33 @@ | ||
{ | ||
"_guid_": "S-185_DeleteDataForMultipleRoleAssignments", | ||
"productName": "Role Assignment Service", | ||
"operationName": "Delete Role Assignments by Process", | ||
"method": "DELETE", | ||
"uri": "/am/role-assignments?process={process}&reference={reference}", | ||
"specs": [ | ||
"to delete role assignments just created above" | ||
], | ||
"users": { | ||
"invokingUser": { | ||
"_extends_": "AmBeftaUser2" | ||
} | ||
}, | ||
"request": { | ||
"headers": { | ||
"Authorization": "[[DEFAULT_AUTO_VALUE]]", | ||
"ServiceAuthorization": "[[DEFAULT_AUTO_VALUE]]", | ||
"X-Correlation-ID": "003352d0-e699-48bc-b6f5-5810411e60af" | ||
}, | ||
"pathVariables": { | ||
"process": "businessProcess1", | ||
"reference": "${[scenarioContext][parentContext][childContexts][S-185_CreationDataForRoleAssignment][testData][request][body][roleRequest][reference]}" | ||
} | ||
}, | ||
"expectedResponse": { | ||
"headers": { | ||
"Content-Length": "[[ANYTHING_PRESENT]]", | ||
"Content-Type": "application/json" | ||
}, | ||
"_extends_": "Common_204_Response" | ||
} | ||
} |
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
Oops, something went wrong.