Skip to content

Commit 3bd0da7

Browse files
merge main
2 parents 3199ce5 + 35cf9c4 commit 3bd0da7

21 files changed

Lines changed: 136 additions & 391 deletions

File tree

.github/actions/build-proxies/action.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,6 @@ runs:
7272
echo "TARGET_DOMAIN=suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
7373
fi
7474
75-
if [ -z $PR_NUMBER ]
76-
then
77-
echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV
78-
echo "TARGET=https://main.$TARGET_DOMAIN" >> $GITHUB_ENV
79-
echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
80-
echo "MTLS_NAME=notify-supplier-mtls" >> $GITHUB_ENV
81-
else
82-
echo "TARGET=https://pr$PR_NUMBER.$TARGET_DOMAIN" >> $GITHUB_ENV
83-
echo "INSTANCE=$PROXYGEN_API_NAME-PR-$PR_NUMBER" >> $GITHUB_ENV
84-
echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
85-
echo "MTLS_NAME=notify-supplier-mtls-pr$PR_NUMBER" >> $GITHUB_ENV
86-
fi
87-
8875
- name: Set APIM_ENV
8976
shell: bash
9077
run: |

.github/actions/test-types.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[
22
"component",
3-
"e2e",
4-
"sandbox"
3+
"e2e"
54
]

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.6-${yyyy}${mm}${dd}.${HH}${MM}${SS}+${hash}
1+
1.2.0-${yyyy}${mm}${dd}.${HH}${MM}${SS}+${hash}

package-lock.json

Lines changed: 0 additions & 208 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/api/components/environments/int/target.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ healthcheck: /_status
33
url: https://main.suppliers.nonprod.nhsnotify.national.nhs.uk
44
security:
55
type: mtls
6-
secret: notify-supplier-mtls-int
6+
secret: nhs-notify-supplier-mtls-int

specification/api/components/environments/internal-dev-pr/target.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ healthcheck: /_status
33
url: https://suppliers.dev.nhsnotify.national.nhs.uk
44
security:
55
type: mtls
6-
secret: nhs-notify-supplier-mtls
6+
secret: nhs-notify-supplier-mtls-internal-dev-prNNN # Will be dynamically set via the proxy-deploy workflow in the internal repo

specification/api/components/environments/internal-dev/target.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ healthcheck: /_status
33
url: https://suppliers.dev.nhsnotify.national.nhs.uk
44
security:
55
type: mtls
6-
secret: nhs-notify-supplier-mtls
6+
secret: nhs-notify-supplier-mtls-internal-dev-main

specification/api/components/environments/ref/target.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ healthcheck: /_status
33
url: https://main.suppliers.nonprod.nhsnotify.national.nhs.uk
44
security:
55
type: mtls
6-
secret: notify-supplier-mtls-ref
6+
secret: nhs-notify-supplier-mtls-ref

tests/component-tests/apiGateway-tests/get-letter-pdf.spec.ts

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { expect, test } from "@playwright/test";
22
import getRestApiGatewayBaseUrl from "../../helpers/aws-gateway-helper";
3-
import { getLettersBySupplier } from "../../helpers/generate-fetch-test-data";
3+
import {
4+
createTestData,
5+
waitForLetterStatus,
6+
} from "../../helpers/generate-fetch-test-data";
47
import {
58
DATA,
69
SUPPLIERID,
@@ -19,16 +22,17 @@ test.describe("API Gateway Tests to Verify Get Letter PDF Endpoint", () => {
1922
test(`Get /letters/{id}/data returns 200 and valid response for a given id`, async ({
2023
request,
2124
}) => {
22-
const letters = await getLettersBySupplier(SUPPLIERID, "PENDING", 1);
25+
const letterIds: string[] = await createTestData(SUPPLIERID);
26+
const createdLetter = await waitForLetterStatus(
27+
SUPPLIERID,
28+
letterIds[0],
29+
"PENDING",
30+
);
2331

24-
if (!letters?.length) {
25-
test.fail(true, `No PENDING letters found for supplier ${SUPPLIERID}`);
26-
return;
27-
}
28-
const letter = letters[0];
2932
const headers = createValidRequestHeaders();
33+
3034
const response = await request.get(
31-
`${baseUrl}/${SUPPLIER_LETTERS}/${letter.id}/${DATA}`,
35+
`${baseUrl}/${SUPPLIER_LETTERS}/${createdLetter.id}/${DATA}`,
3236
{
3337
headers,
3438
},
@@ -63,32 +67,13 @@ test.describe("API Gateway Tests to Verify Get Letter PDF Endpoint", () => {
6367
expect(after.status).toBe(403);
6468
});
6569

66-
test(`Get /letters/{id}/data returns 404 if no resource is found for id`, async ({
67-
request,
68-
}) => {
69-
const id = "11";
70-
const headers = createValidRequestHeaders();
71-
const response = await request.get(
72-
`${baseUrl}/${SUPPLIER_LETTERS}/${id}/${DATA}`,
73-
{
74-
headers,
75-
},
76-
);
77-
78-
const responseBody = await response.json();
79-
expect(response.status()).toBe(404);
80-
expect(responseBody).toMatchObject(error404ResponseBody());
81-
});
82-
83-
// CCM-14318: Remove this test
8470
test(`Get /letters/{id}/data returns 404 if letter is not found for supplierId ${SUPPLIERID}`, async ({
8571
request,
8672
}) => {
8773
const id = "non-existing-id-12345";
8874
const headers = createValidRequestHeaders();
8975
const response = await request.get(
90-
`
91-
${baseUrl}/${SUPPLIER_LETTERS}/${id}/${DATA}`,
76+
`${baseUrl}/${SUPPLIER_LETTERS}/${id}/${DATA}`,
9277
{
9378
headers,
9479
},

tests/component-tests/apiGateway-tests/get-letter-status.spec.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { expect, test } from "@playwright/test";
22
import getRestApiGatewayBaseUrl from "../../helpers/aws-gateway-helper";
3-
import { getLettersBySupplier } from "../../helpers/generate-fetch-test-data";
3+
import {
4+
createTestData,
5+
waitForLetterStatus,
6+
} from "../../helpers/generate-fetch-test-data";
47
import { SUPPLIERID, SUPPLIER_LETTERS } from "../../constants/api-constants";
58
import { createValidRequestHeaders } from "../../constants/request-headers";
69
import { error404ResponseBody } from "../../helpers/common-types";
@@ -15,16 +18,16 @@ test.describe("API Gateway Tests to Verify Get Letter Status Endpoint", () => {
1518
test(`Get /letters/{id} returns 200 and valid response for a given id`, async ({
1619
request,
1720
}) => {
18-
const letters = await getLettersBySupplier(SUPPLIERID, "PENDING", 1);
21+
const letterIds: string[] = await createTestData(SUPPLIERID);
22+
const createdLetter = await waitForLetterStatus(
23+
SUPPLIERID,
24+
letterIds[0],
25+
"PENDING",
26+
);
1927

20-
if (!letters?.length) {
21-
test.fail(true, `No PENDING letters found for supplier ${SUPPLIERID}`);
22-
return;
23-
}
24-
const letter = letters[0];
2528
const headers = createValidRequestHeaders();
2629
const response = await request.get(
27-
`${baseUrl}/${SUPPLIER_LETTERS}/${letter.id}`,
30+
`${baseUrl}/${SUPPLIER_LETTERS}/${createdLetter.id}`,
2831
{
2932
headers,
3033
},
@@ -37,10 +40,10 @@ test.describe("API Gateway Tests to Verify Get Letter Status Endpoint", () => {
3740
data: {
3841
attributes: {
3942
status: "PENDING",
40-
specificationId: letter.specificationId,
41-
groupId: letter.groupId,
43+
specificationId: createdLetter.specificationId,
44+
groupId: createdLetter.groupId,
4245
},
43-
id: letter.id,
46+
id: createdLetter.id,
4447
type: "Letter",
4548
},
4649
});

0 commit comments

Comments
 (0)