Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCM-6434: Simon test #829

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 3 additions & 0 deletions docs/tests/development/generic/content_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ This test uses the ‘X-Correlation-Id’ header, when provided in a request it

**Asserts**
- Response returns a 201 status code
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids

## 415 - Unsupported Media

Expand Down
30 changes: 18 additions & 12 deletions docs/tests/development/post_v1_message-batches/happy_path.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with valid contact details receives a 201 response
Expand All @@ -29,8 +30,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains request ID
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid content type header receives a 201 response
Expand All @@ -44,8 +46,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid date of birth receives a 201 response
Expand All @@ -59,8 +62,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid NHS number receives a 201 response
Expand All @@ -74,8 +78,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a date of birth receives a 201 response
Expand All @@ -89,5 +94,6 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids
3 changes: 3 additions & 0 deletions docs/tests/development/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

**Asserts**
- Response returns a 201 status code
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response
Expand Down
30 changes: 18 additions & 12 deletions docs/tests/integration/post_v1_message-batches/happy_path.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with valid contact details receives a 201 response
Expand All @@ -29,8 +30,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains request ID
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid content type header receives a 201 response
Expand All @@ -44,8 +46,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid date of birth receives a 201 response
Expand All @@ -59,8 +62,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid NHS number receives a 201 response
Expand All @@ -74,8 +78,9 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids



Expand All @@ -90,5 +95,6 @@

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids
3 changes: 3 additions & 0 deletions docs/tests/integration/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

**Asserts**
- Response returns a 201 status code
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response
Expand Down
3 changes: 3 additions & 0 deletions docs/tests/production/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

**Asserts**
- Response returns a 201 status code
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response
Expand Down
35 changes: 21 additions & 14 deletions docs/tests/sandbox/post_v1_message-batches/happy_path.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ These tests target the API endpoint v1/message-batches testing successful respon

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with valid contact details receives a 201 response
Expand All @@ -31,8 +32,9 @@ These tests target the API endpoint v1/message-batches testing successful respon

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains request ID
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid content type header receives a 201 response
Expand All @@ -46,8 +48,9 @@ These tests target the API endpoint v1/message-batches testing successful respon

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid date of birth receives a 201 response
Expand All @@ -61,8 +64,9 @@ These tests target the API endpoint v1/message-batches testing successful respon

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid NHS number receives a 201 response
Expand All @@ -76,8 +80,9 @@ These tests target the API endpoint v1/message-batches testing successful respon

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a valid routing plan header receives a 201 response
Expand All @@ -91,8 +96,9 @@ These tests target the API endpoint v1/message-batches testing successful respon

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


### Scenario: An API consumer creating a batch of messages with a date of birth receives a 201 response
Expand All @@ -106,5 +112,6 @@ These tests target the API endpoint v1/message-batches testing successful respon

**Asserts**
- Response returns a 201 status code
- Response body matches expected result
- Response contains correctly formatted link to new message URI
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids
6 changes: 6 additions & 0 deletions docs/tests/sandbox/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

**Asserts**
- Response returns a 201 status code
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids


## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response
Expand Down Expand Up @@ -47,3 +50,6 @@

**Asserts**
- Response returns a 201 status code
- Response contains routingPlanId
- Response contains messageBatchReference
- Response contains a messages array with expected message references and ids
5 changes: 1 addition & 4 deletions proxies/live/apiproxy/targets/target.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
<SSLInfo>
<Enabled>true</Enabled>
</SSLInfo>
<LoadBalancer>
<Server name="{{ TARGET_SERVER_OVERRIDE | default('communications-manager-target') }}"/>
</LoadBalancer>
<Path>{requestpath}</Path>
<URL>https://comms-apim.de-sila7.communications.national.nhs.uk</URL>
<Properties>
<Property name="io.timeout.millis">29000</Property>
</Properties>
Expand Down
2 changes: 1 addition & 1 deletion proxies/sandbox/apiproxy/targets/sandbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<HTTPTargetConnection>
{{ HOSTED_TARGET_CONNECTION }}
<Properties>
<Property name="io.timeout.millis">2000</Property>
<Property name="io.timeout.millis">10000</Property>
</Properties>
</HTTPTargetConnection>
</TargetEndpoint>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<Name>requestpath</Name>
<Value>/api/v1/send</Value>
</AssignVariable>
{% if ENVIRONMENT_TYPE != 'sandbox' %}
<AssignVariable>
<Name>target.url</Name>
<Value>https://comms-apim.de-sila7.communications.national.nhs.uk/api/v1/send</Value>
</AssignVariable>
{% endif %}
<Set>
<Payload contentType="application/json" variablePrefix="%" variableSuffix="#">%data.payload#</Payload>
<Headers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
<Payload variablePrefix="%" variableSuffix="#">
{
"data" : {
"type" : "MessageBatch",
"id" : "%data.requestId#",
"attributes" : {
"messageBatchReference" : "%data.messageBatchReference#",
"type": "MessageBatch",
"id": "%data.requestId#",
"attributes": {
"messageBatchReference": "%data.messageBatchReference#",
"routingPlan": {
"id" : "%data.routingPlanId#",
"version" : "%data.routingPlanVersion#",
"id": "%data.routingPlanId#",
"version": "%data.routingPlanVersion#",
"name": "%data.routingPlanName#",
"createdDate": "%data.routingPlanCreatedDate#"
}
},
"messages": %data.messages#
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
<Name>requestpath</Name>
<Value>/api/v1/messages</Value>
</AssignVariable>

{% if ENVIRONMENT_TYPE != 'sandbox' %}
<AssignVariable>
<Name>target.url</Name>
<Value>https://comms-apim.de-sila7.communications.national.nhs.uk/api/v1/messages</Value>
</AssignVariable>
{% endif %}
<Set>
<Payload contentType="application/json" variablePrefix="%" variableSuffix="#">%data.payload#</Payload>
<Headers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
<Name>requestpath</Name>
<Template>/api/v1/messages/{data.messageId}</Template>
</AssignVariable>

{% if ENVIRONMENT_TYPE != 'sandbox' %}
<AssignVariable>
<Name>target.url</Name>
<Value>https://comms-apim.de-sila7.communications.national.nhs.uk/api/v1/messages/{data.messageId}</Value>
</AssignVariable>
{% endif %}
<Set>
<Headers>
<Header name="X-Correlation-Id">{backendCorrelationId}</Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<Name>requestpath</Name>
<Value>/api/channels/nhsapp/accounts</Value>
</AssignVariable>
{% if ENVIRONMENT_TYPE != 'sandbox' %}
<AssignVariable>
<Name>target.url</Name>
<Value>https://comms-apim.de-sila7.communications.national.nhs.uk/api/channels/nhsapp/accounts</Value>
</AssignVariable>
{% endif %}
<Set>
<Headers>
<Header name="X-Correlation-Id">{backendCorrelationId}</Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<Variable name="routingPlanCreatedDate" type="string">
<JSONPath>$.routingPlan.createdDate</JSONPath>
</Variable>
<Variable name="messages" type="string">
<JSONPath>$.messages</JSONPath>
</Variable>
</JSONPayload>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</ExtractVariables>
Loading
Loading