Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@F-1026
Feature: F-1026: Get jurisdictions available to the user

Background: Load test data for the scenario
Given an appropriate test context as detailed in the test data source

@S-1026.1
Scenario: must return a list of jurisdictions for a valid user
Given a user with [an active profile in CCD having create case access for a jurisdiction],
When a request is prepared with appropriate values,
And the request [has CREATE as case access parameter],
And it is submitted to call the [Get jurisdictions available to the user] operation of [CCD Data Store],
Then a positive response is received,
And the response [contains HTTP 200 Ok status code],
And the response [contains the list of jurisdictions a user has access to],
And the response has all other details as expected.

@S-1026.2
Scenario: must return 400 if access type is not in create, read or update
Given a user with [a detailed profile in CCD having create case access for a jurisdiction],
When a request is prepared with appropriate values,
And the request [has DELETE as case access parameter],
And it is submitted to call the [Get jurisdictions available to the user] operation of [CCD Data Store],
Then a negative response is received,
And the response [contains HTTP 400 Bad Request],
And the response [contains an error message : Access can only be 'create', 'read' or 'update'],
And the response has all other details as expected.

@S-1026.3
Scenario: must return a list of jurisdictions for a valid user with no user profile
Given a user with [appropriate idam roles but no CCD user profile],
When a request is prepared with appropriate values,
And the request [has CREATE as case access parameter],
And it is submitted to call the [Get jurisdictions available to the user] operation of [CCD Data Store],
Then a positive response is received,
And the response [contains the list of jurisdictions a user has access to],
And the response has all other details as expected.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"_guid_": "F-1026_Test_Data_Base",
"title": "Get jurisdictions available to the user",
"productName": "CCD Data Store",
"operationName": "Get jurisdictions available to the user",
"method": "GET",
"uri": "/aggregated/caseworkers/{uid}/jurisdictions-lite",
"request": {
"_extends_": "Common_Request",
"pathVariables": {
"uid": "[[DEFAULT_AUTO_VALUE]]"
}
},
"user": {
"_extends_": "BeftaCaseworker1"
},
"expectedResponse": {
"headers": {
"_extends_": "Common_Response_Headers",
"Content-Length": "[[ANYTHING_PRESENT]]",
"Content-Type": "[[ANYTHING_PRESENT]]",
"Content-Encoding": "[[ANYTHING_PRESENT]]"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"_guid_": "S-1026.1",
"_extends_": "F-1026_Test_Data_Base",
"title": "Get jurisdictions available to the user",
"specs": [
"an active profile in CCD having create case access for a jurisdiction",
"has CREATE as case access parameter",
"contains HTTP 200 Ok status code",
"contains the list of jurisdictions a user has access to"
],
"request": {
"_extends_": "Common_Request",
"queryParams": {
"access": "create"
}
},
"expectedResponse": {
"_extends_": "Common_200_Response",
"body": {
"arrayInMap": [
{
"id": "BEFTA_JURISDICTION_1",
"name": "BEFTA_JURISDICTION_1",
"description": "Content for the Test Jurisdiction.",
"caseTypes": [
{
"__ordering__": "unordered"
},
{
"id": "BEFTA_CASETYPE_1_1",
"description": "Create a case of type BEFTA_CASETYPE_1_1",
"version": null,
"name": "BEFTA Case Type 1 1",
"events": "[[ANYTHING_PRESENT]]",
"states": "[[ANYTHING_PRESENT]]",
"security_classification": null
},
{
"id" : "BEFTA_CASETYPE_NO_READ",
"description" : "Create a case of type BEFTA_CASETYPE_NO_READ",
"version" : null,
"name" : "BEFTA Case Type No Read",
"events": "[[ANYTHING_PRESENT]]",
"states": "[[ANYTHING_PRESENT]]",
"security_classification": null
},
{
"id": "CASE_TYPE_WITH_NO_CASES",
"description": "Create a case of type CASE_TYPE_WITH_NO_CASES",
"version": null,
"name": "CT With No Cases -Don't Create",
"events": "[[ANYTHING_PRESENT]]",
"states": "[[ANYTHING_PRESENT]]",
"security_classification": null
},
{
"id" : "CaseAccessGroups_Casetype",
"description" : "For testing Case Access Group",
"version" : null,
"name" : "CaseAccessGroups_Casetype",
"events": "[[ANYTHING_PRESENT]]",
"states": "[[ANYTHING_PRESENT]]",
"security_classification": null
}
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-1026.2",
"_extends_": "F-1026_Test_Data_Base",
"title": "must return 400 if access type is not in create, read or update",
"specs": [
"a detailed profile in CCD having create case access for a jurisdiction",
"contains HTTP 400 Bad Request",
"has DELETE as case access parameter",
"contains an error message : Access can only be 'create', 'read' or 'update'"
],
"request": {
"queryParams": {
"access": "delete"
}
},
"expectedResponse": {
"_extends_": "Common_400_Response",
"headers": {
"_extends_": "Common_400_Response_Headers"
},
"body": {
"_extends_": "Common_400_Response_Body",
"exception": "uk.gov.hmcts.ccd.endpoint.exceptions.BadRequestException",
"message": "Access can only be 'create', 'read' or 'update'",
"path": "[[ANYTHING_PRESENT]]",
"details": null,
"callbackErrors": null,
"callbackWarnings": null
}
}
}
Loading