Skip to content

Commit

Permalink
Merge pull request #762 from NHSDigital/release
Browse files Browse the repository at this point in the history
Release v4.28.0
  • Loading branch information
Ian-Hodges authored Oct 10, 2024
2 parents 9bb09e3 + 493974a commit 180e07d
Show file tree
Hide file tree
Showing 84 changed files with 1,811 additions and 660 deletions.
8 changes: 4 additions & 4 deletions docs/tests/development/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Performance Tests


## Scenario: An API consumer submitting a request with a request body containing 50,000 messages receives a 201 response
## Scenario: An API consumer submitting a request with a request body containing 40,000 messages receives a 201 response

**Given** the API consumer provides a message body of around 50k messages
**Given** the API consumer provides a message body of around 40k messages
<br/>
**When** the request is submitted
<br/>
Expand All @@ -16,9 +16,9 @@
- Response returns a 201 status code


## Scenario: An API consumer submitting a request with a large request body containing 50,000 duplicate messages receives a 400 response
## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response

**Given** the API consumer provides a message body of 50,000 duplicate messages
**Given** the API consumer provides a message body of 40,000 duplicate messages
<br/>
**When** the request is submitted
<br/>
Expand Down
6 changes: 3 additions & 3 deletions docs/tests/development/post_v1_message-batches/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,19 @@ A valid contact detail must be structured in this format: { sms: value, email: v
| LS1 6AECD | Used to ensure only valid postcode is accepted |


## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down
6 changes: 3 additions & 3 deletions docs/tests/development/post_v1_messages/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ A valid contact detail must be structured in this format: { sms: value, email: v
| LS1 6AECD | Used to ensure only valid postcode is accepted |


## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down
8 changes: 4 additions & 4 deletions docs/tests/integration/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Performance Tests


## Scenario: An API consumer submitting a request with a request body containing 50,000 messages receives a 201 response
## Scenario: An API consumer submitting a request with a request body containing 40,000 messages receives a 201 response

**Given** the API consumer provides a message body of around 50k messages
**Given** the API consumer provides a message body of around 40k messages
<br/>
**When** the request is submitted
<br/>
Expand All @@ -16,9 +16,9 @@
- Response returns a 201 status code


## Scenario: An API consumer submitting a request with a large request body containing 50,000 duplicate messages receives a 400 response
## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response

**Given** the API consumer provides a message body of 50,000 duplicate messages
**Given** the API consumer provides a message body of 40,000 duplicate messages
<br/>
**When** the request is submitted
<br/>
Expand Down
6 changes: 3 additions & 3 deletions docs/tests/integration/post_v1_message-batches/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,19 @@ A valid contact detail must be structured in this format: { sms: value, email: v
| LS1 6AECD | Used to ensure only valid postcode is accepted |


## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down
6 changes: 3 additions & 3 deletions docs/tests/integration/post_v1_messages/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ A valid contact detail must be structured in this format: { sms: value, email: v
| LS1 6AECD | Used to ensure only valid postcode is accepted |


## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down
8 changes: 4 additions & 4 deletions docs/tests/production/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Performance Tests


## Scenario: An API consumer submitting a request with a request body containing 50,000 messages receives a 201 response
## Scenario: An API consumer submitting a request with a request body containing 40,000 messages receives a 201 response

**Given** the API consumer provides a message body of around 50k messages
**Given** the API consumer provides a message body of around 40k messages
<br/>
**When** the request is submitted
<br/>
Expand All @@ -16,9 +16,9 @@
- Response returns a 201 status code


## Scenario: An API consumer submitting a request with a large request body containing 50,000 duplicate messages receives a 400 response
## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response

**Given** the API consumer provides a message body of 50,000 duplicate messages
**Given** the API consumer provides a message body of 40,000 duplicate messages
<br/>
**When** the request is submitted
<br/>
Expand Down
6 changes: 3 additions & 3 deletions docs/tests/production/post_v1_message-batches/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,19 @@ A valid contact detail must be structured in this format: { sms: value, email: v
| LS1 6AECD | Used to ensure only valid postcode is accepted |


## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down
6 changes: 3 additions & 3 deletions docs/tests/production/post_v1_messages/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ A valid contact detail must be structured in this format: { sms: value, email: v
| LS1 6AECD | Used to ensure only valid postcode is accepted |


## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down
12 changes: 6 additions & 6 deletions docs/tests/sandbox/post_v1_message-batches/performance.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Performance Tests


## Scenario: An API consumer submitting a request with a request body containing 50,000 messages receives a 201 response
## Scenario: An API consumer submitting a request with a request body containing 40,000 messages receives a 201 response

**Given** the API consumer provides a message body of around 50k messages
**Given** the API consumer provides a message body of around 40k messages
<br/>
**When** the request is submitted
<br/>
Expand All @@ -16,9 +16,9 @@
- Response returns a 201 status code


## Scenario: An API consumer submitting a request with a large request body containing 50,000 duplicate messages receives a 400 response
## Scenario: An API consumer submitting a request with a large request body containing 40,000 duplicate messages receives a 400 response

**Given** the API consumer provides a message body of 50,000 duplicate messages
**Given** the API consumer provides a message body of 40,000 duplicate messages
<br/>
**When** the request is submitted
<br/>
Expand All @@ -34,9 +34,9 @@
- Response returns 100 error message blocks


## Scenario: An API consumer submitting a request with a request body containing 50,000 messages receives a 201 response
## Scenario: An API consumer submitting a request with a request body containing 40,000 messages receives a 201 response

**Given** the API consumer provides a message body of around 50k messages
**Given** the API consumer provides a message body of around 40k messages
<br/>
**When** the request is submitted
<br/>
Expand Down
21 changes: 18 additions & 3 deletions docs/tests/sandbox/post_v1_message-batches/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,19 @@ This test uses the ‘X-Correlation-Id’ header, when provided in a request it
| 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 request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down Expand Up @@ -451,6 +451,21 @@ A valid sms contact detail must be structured in this format: { sms: value }
| 077009000021 | Used to ensure invalid phone number is not accepted |


## Scenario: An API consumer submitting a request with an contact details when not allowed receives a 400 ‘Cannot set contact details’ response

**Given** the API consumer provides a message body with contact details
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 Cannot set contact details error
<br/>

**Asserts**
- Response returns a 400 ‘Cannot set contact details’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided


## Scenario: An API consumer submitting a request with an invalid personalisation receives a 400 ‘Invalid Value’ response

A valid personalisation must be structured in this format: { parameter: value }
Expand Down
21 changes: 18 additions & 3 deletions docs/tests/sandbox/post_v1_messages/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ This test uses the ‘X-Correlation-Id’ header, when provided in a request it
| 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 request with invalid address lines (too few) receives a 400 ‘Missing Value’ response
## Scenario: An API consumer submitting a request with invalid address lines (too few) receives a 400 ‘Too few items’ response

A valid contact detail must be structured in this format: { address: { lines: [ Value1, Value2 ], postcode: value } }

**Given** the API consumer provides an message body with with too few address lines
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
**Then** the response returns a 400 too few items error
<br/>

**Asserts**
- Response returns a 400 ‘Missing value’ error
- Response returns a 400 ‘Too few items’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided

Expand Down Expand Up @@ -313,6 +313,21 @@ A valid sms contact detail must be structured in this format: { sms: value }
| 077009000021 | Used to ensure invalid phone number is not accepted |


## Scenario: An API consumer submitting a request with an contact details when not allowed receives a 400 ‘Cannot set contact details’ response

**Given** the API consumer provides a message body with contact details
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 Cannot set contact details error
<br/>

**Asserts**
- Response returns a 400 ‘Cannot set contact details’ error
- Response returns the expected error message body with references to the invalid attribute
- Response returns the ‘X-Correlation-Id’ header if provided


## Scenario: An API consumer submitting a request with an invalid personalisation receives a 400 ‘Invalid Value’ response

A valid personalisation must be structured in this format: { parameter: value }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Name>JavaScript.MessageBatches.Create.Validate</Name>
</Step>
<Step>
<Name>RaiseFault.400BadRequest</Name>
<Name>RaiseFault.4xxGeneric</Name>
<Condition>errors != null</Condition>
</Step>
<Step>
Expand All @@ -31,4 +31,4 @@
<Condition>
(proxy.pathsuffix MatchesPath "/v1/message-batches") and (request.verb = "POST")
</Condition>
</Flow>
</Flow>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Name>JavaScript.Messages.Create.Validate</Name>
</Step>
<Step>
<Name>RaiseFault.400BadRequest</Name>
<Name>RaiseFault.4xxGeneric</Name>
<Condition>errors != null</Condition>
</Step>
<Step>
Expand All @@ -31,4 +31,4 @@
<Condition>
(proxy.pathsuffix MatchesPath "/v1/messages") and (request.verb = "POST")
</Condition>
</Flow>
</Flow>
6 changes: 6 additions & 0 deletions proxies/shared/partials/Partial.Target.FaultRules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
<Name>RaiseFault.404NotFound</Name>
<Condition>response.status.code = 404</Condition>
</Step>
<Step>
<Name>RaiseFault.413RequestTooLarge</Name>
<Condition>
response.status.code = 413 and response.content Like "*Request Too Long*"
</Condition>
</Step>
<Step>
<Name>RaiseFault.400BackendException.OdsCodeRequired</Name>
<Condition>response.status.code = 400 and response.content Like "*odsCode must be provided*"</Condition>
Expand Down
Loading

0 comments on commit 180e07d

Please sign in to comment.