Skip to content

Commit 09c2075

Browse files
committed
Fix client subscription fixture in int test
1 parent 276236c commit 09c2075

File tree

1 file changed

+31
-41
lines changed

1 file changed

+31
-41
lines changed

tests/integration/jest.global-setup.ts

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,38 @@ import {
99

1010
const mockClientSubscriptionKey = "client_subscriptions/mock-client.json";
1111

12-
const mockClientSubscriptionBody = JSON.stringify([
13-
{
14-
SubscriptionId: "mock-client",
15-
SubscriptionType: "MessageStatus",
16-
ClientId: "mock-client",
17-
MessageStatuses: ["DELIVERED"],
18-
Targets: [
19-
{
20-
Type: "API",
21-
TargetId: "445527ff-277b-43a4-a4b0-15eedbd71597",
22-
InvocationEndpoint: "https://some-mock-client.endpoint/webhook",
23-
InvocationMethod: "POST",
24-
InvocationRateLimit: 10,
25-
APIKey: {
26-
HeaderName: "x-api-key",
27-
HeaderValue: "some-api-key",
28-
},
12+
const mockClientSubscriptionBody = JSON.stringify({
13+
clientId: "mock-client",
14+
subscriptions: [
15+
{
16+
subscriptionId: "mock-client",
17+
subscriptionType: "MessageStatus",
18+
messageStatuses: ["DELIVERED"],
19+
targetIds: ["445527ff-277b-43a4-a4b0-15eedbd71597"],
20+
},
21+
{
22+
subscriptionId: "mock-client-channel",
23+
subscriptionType: "ChannelStatus",
24+
channelStatuses: ["DELIVERED"],
25+
channelType: "NHSAPP",
26+
supplierStatuses: ["delivered"],
27+
targetIds: ["445527ff-277b-43a4-a4b0-15eedbd71597"],
28+
},
29+
],
30+
targets: [
31+
{
32+
type: "API",
33+
targetId: "445527ff-277b-43a4-a4b0-15eedbd71597",
34+
invocationEndpoint: "https://some-mock-client.endpoint/webhook",
35+
invocationMethod: "POST",
36+
invocationRateLimit: 10,
37+
apiKey: {
38+
headerName: "x-api-key",
39+
headerValue: "some-api-key",
2940
},
30-
],
31-
},
32-
{
33-
SubscriptionId: "mock-client-channel",
34-
SubscriptionType: "ChannelStatus",
35-
ClientId: "mock-client",
36-
ChannelStatuses: ["DELIVERED"],
37-
ChannelType: "NHSAPP",
38-
SupplierStatuses: ["delivered"],
39-
Targets: [
40-
{
41-
Type: "API",
42-
TargetId: "445527ff-277b-43a4-a4b0-15eedbd71597",
43-
InvocationEndpoint: "https://some-mock-client.endpoint/webhook",
44-
InvocationMethod: "POST",
45-
InvocationRateLimit: 10,
46-
APIKey: {
47-
HeaderName: "x-api-key",
48-
HeaderValue: "some-api-key",
49-
},
50-
},
51-
],
52-
},
53-
]);
41+
},
42+
],
43+
});
5444

5545
export default async function globalSetup() {
5646
const deploymentDetails = getDeploymentDetails();

0 commit comments

Comments
 (0)