Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ e2e-test-uat:
else \
printf "\nMissing API_ENVIRONMENT environment variable\n\n"; exit 1; \
fi

.test:
$(TEST_CMD) \
tests/api \
Expand Down
4 changes: 0 additions & 4 deletions docs/tests/post_v1_message-batches/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ Below is a table showing the required attributes and their locations as seen in

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

The message batch reference must be in a UUID format, for more information on UUID, look [here](https://en.wikipedia.org/wiki/Universally_unique_identifier)

**Given** the API consumer provides an message body with an invalid message batch reference
<br/>
**When** the request is submitted
Expand All @@ -251,8 +249,6 @@ The message batch reference must be in a UUID format, for more information on UU

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

The message reference must be in a UUID format, for more information on UUID, look [here](https://en.wikipedia.org/wiki/Universally_unique_identifier)

**Given** the API consumer provides an message body with an invalid message reference
<br/>
**When** the request is submitted
Expand Down
61 changes: 45 additions & 16 deletions docs/tests/post_v1_single-message/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ A valid sms contact detail must be structured in this format: { sms: Value } whe
- Response returns the expected error message body with references to the invalid attribute


## Scenario: An API consumer submitting a request without a request body receives a 400 ‘Invalid Value’ response

**Given** the API consumer provides an empty message body
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
<br/>

**Asserts**
- Response returns a 400 ‘Invalid Value’ error
- Response returns the expected error message body


## Scenario: An API consumer submitting a message with an invalid required attribute in the request body receives a 400 ‘Invalid Value’ response

**Given** the API consumer provides an message body with an invalid attribute
Expand Down Expand Up @@ -126,24 +140,8 @@ Below is a table showing the required attributes and their locations as seen in
| nhsNumber | /data/attributes/recipient/nhsNumber |


## Scenario: An API consumer submitting a request without a request body receives a 400 ‘Invalid Value’ response

**Given** the API consumer provides an empty message body
<br/>
**When** the request is submitted
<br/>
**Then** the response returns a 400 invalid value error
<br/>

**Asserts**
- Response returns a 400 ‘Invalid Value’ error
- Response returns the expected error message body


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

The message reference must be in a UUID format, for more information on UUID, look [here](https://en.wikipedia.org/wiki/Universally_unique_identifier)

**Given** the API consumer provides an message body with an invalid message reference
<br/>
**When** the request is submitted
Expand Down Expand Up @@ -193,6 +191,37 @@ A valid personalisation must be structured in this format: { parameter: Value }
| 5, “”, “some-string”, [] | Are tested to ensure that invalid personalisation values are not accepted |


## Scenario: An API consumer submitting a message with an invalid required attribute in the request body receives a 400 ‘Invalid Value’ response

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

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

**Request Properties**

This test uses a method to replace the values in the response body, it sets the new value, and sets the value of the location of where the attribute has been changed.

Below is a table showing the required attributes and their locations as seen in the response body.

| Attribute | Location |
|------------------|--------------------------------------|
| data | /data |
| type | /data/type |
| attributes | /data/attributes |
| routingPlanId | /data/attributes/routingPlanId |
| messageReference | /data/attributes/messageReference |
| recipient | /data/attributes/recipient |
| nhsNumber | /data/attributes/recipient/nhsNumber |


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

The routing plan must be in a UUID format, for more information on UUID, look [here](https://en.wikipedia.org/wiki/Universally_unique_identifier)
Expand Down
4 changes: 0 additions & 4 deletions docs/tests/sandbox/post_v1_message-batches/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ A valid email contact detail must be structured in this format: { email: Value }

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

The message batch reference must be in a UUID format, for more information on UUID, look [here](https://en.wikipedia.org/wiki/Universally_unique_identifier)

**Given** the API consumer provides an message body with an invalid message batch reference
<br/>
**When** the request is submitted
Expand All @@ -221,8 +219,6 @@ The message batch reference must be in a UUID format, for more information on UU

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

The message reference must be in a UUID format, for more information on UUID, look [here](https://en.wikipedia.org/wiki/Universally_unique_identifier)

**Given** the API consumer provides an message body with an invalid message reference
<br/>
**When** the request is submitted
Expand Down
2 changes: 0 additions & 2 deletions docs/tests/sandbox/post_v1_messages/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ A valid email contact detail must be structured in this format: { email: Value }

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

The message reference must be in a UUID format, for more information on UUID, look [here](https://en.wikipedia.org/wiki/Universally_unique_identifier)

**Given** the API consumer provides an message body with an invalid message reference
<br/>
**When** the request is submitted
Expand Down
Loading