Skip to content

Commit

Permalink
Merge pull request #693 from NHSDigital/v4.23.0
Browse files Browse the repository at this point in the history
V4.23.0
  • Loading branch information
alexnuttall authored Aug 2, 2024
2 parents 5a2c57a + 89095db commit 8a0ab78
Show file tree
Hide file tree
Showing 45 changed files with 9,459 additions and 738 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ install: install-node install-python .git/hooks/pre-commit
install-hooks: .git/hooks/pre-commit

#Run the npm linting script (specified in package.json). Used to check the syntax and formatting of files.
lint: .check-licenses .ensure-test-documentation-validity
npm run lint
find . -name '*.py' -not -path '**/.venv/*' | xargs poetry run flake8
lint: .check-licenses .ensure-test-documentation-validity .lint-js .lint-python
npm run lint

static-analysis:
npm run static-analysis
Expand All @@ -48,6 +47,14 @@ build-proxy:
build-test-documentation:
cd tests/docs && ./build-docs.sh --build-only && cd ../../

# Lint JavaScript files
.lint-js:
node_modules/.bin/eslint sandbox/

# Lint Python files
.lint-python:
find . -name '*.py' -not -path '**/.venv/*' | xargs poetry run flake8

#Files to loop over in release
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests sandbox package.json package-lock.json postman scripts"

Expand Down
23 changes: 23 additions & 0 deletions docs/tests/development/get_channels_nhsapp_accounts/502.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,26 @@

These tests target the API endpoint GET /channels/nhsapp/accounts testing that 502 is returned when the BE can’t contact the NHS App API


## Scenario: An API consumer submitting a request when the backend service responds with a 502 Bad Gateway error

**Given** the backend service is unable to call a downstream service
<br/>
**When** the request is submitted
<br/>
**Then** the response is a 502 bad gateway error
<br/>

**Asserts**
- Response returns a 502 ‘Bad Gateway’ error
- Response returns the expected error message body
- Response returns the ‘X-Correlation-Id’ header if provided

**Correlation IDs**

This test uses the ‘X-Correlation-Id’ header, when provided in a request it is returned in the response.

| Value | Description |
|--------------------------------------|---------------------------------------------------------------------------------------------------------------|
| None | Is tested to ensure that we do not send back a correlation identifier if one was not provided in the request. |
| 76491414-d0cf-4655-ae20-a4d1368472f3 | Is tested to ensure that when a correlation identifier is sent, we respond with the same value. |
23 changes: 23 additions & 0 deletions docs/tests/integration/get_channels_nhsapp_accounts/400.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ This test uses the ‘page’ query parameter to select a page of the report.
| 8 | A valid page number |


## Scenario: An API consumer submitting a GET NHS App Accounts request an invalid page

**Given** the API consumer sends a request to get NHS App Accounts with an invalid page
<br/>
**When** the request is submitted
<br/>
**Then** the service responds with a 400 invalid response, telling the user the page is invalid
<br/>

**Asserts**
- Response returns a 400 ‘Invalid’ error
- Response returns the expected error message body
- Response returns the ‘X-Correlation-Id’ header if provided

**Correlation IDs**

This test uses the ‘X-Correlation-Id’ header, when provided in a request it is returned in the response.

| Value | Description |
|--------------------------------------|---------------------------------------------------------------------------------------------------------------|
| None | Is tested to ensure that we do not send back a correlation identifier if one was not provided in the request. |
| 76491414-d0cf-4655-ae20-a4d1368472f3 | Is tested to ensure that when a correlation identifier is sent, we respond with the same value. |


## Scenario: An API consumer submitting a GET NHS App Accounts request without an ODS Code

Expand Down
23 changes: 23 additions & 0 deletions docs/tests/production/get_channels_nhsapp_accounts/400.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ This test uses the ‘page’ query parameter to select a page of the report.
| 8 | A valid page number |


## Scenario: An API consumer submitting a GET NHS App Accounts request an invalid page

**Given** the API consumer sends a request to get NHS App Accounts with an invalid page
<br/>
**When** the request is submitted
<br/>
**Then** the service responds with a 400 invalid response, telling the user the page is invalid
<br/>

**Asserts**
- Response returns a 400 ‘Invalid’ error
- Response returns the expected error message body
- Response returns the ‘X-Correlation-Id’ header if provided

**Correlation IDs**

This test uses the ‘X-Correlation-Id’ header, when provided in a request it is returned in the response.

| Value | Description |
|--------------------------------------|---------------------------------------------------------------------------------------------------------------|
| None | Is tested to ensure that we do not send back a correlation identifier if one was not provided in the request. |
| 76491414-d0cf-4655-ae20-a4d1368472f3 | Is tested to ensure that when a correlation identifier is sent, we respond with the same value. |


## Scenario: An API consumer submitting a GET NHS App Accounts request without an ODS Code

Expand Down
23 changes: 23 additions & 0 deletions docs/tests/sandbox/get_channels_nhsapp_accounts/502.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,26 @@

These tests target the API endpoint GET /channels/nhsapp/accounts testing that 502 is returned when the BE can’t contact the NHS App API


## Scenario: An API consumer submitting a request when the backend service responds with a 502 Bad Gateway error

**Given** the backend service is unable to call a downstream service
<br/>
**When** the request is submitted
<br/>
**Then** the response is a 502 bad gateway error
<br/>

**Asserts**
- Response returns a 502 ‘Bad Gateway’ error
- Response returns the expected error message body
- Response returns the ‘X-Correlation-Id’ header if provided

**Correlation IDs**

This test uses the ‘X-Correlation-Id’ header, when provided in a request it is returned in the response.

| Value | Description |
|--------------------------------------|---------------------------------------------------------------------------------------------------------------|
| None | Is tested to ensure that we do not send back a correlation identifier if one was not provided in the request. |
| 76491414-d0cf-4655-ae20-a4d1368472f3 | Is tested to ensure that when a correlation identifier is sent, we respond with the same value. |
Loading

0 comments on commit 8a0ab78

Please sign in to comment.