Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
7 changes: 7 additions & 0 deletions terraform/infrastructure/modules/api_gateway/api_gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ resource "aws_api_gateway_method" "capability" {
resource_id = aws_api_gateway_resource.capability.id
http_method = "GET"
authorization = "NONE"

depends_on = [aws_api_gateway_resource.capability]
}

resource "aws_api_gateway_integration" "capability" {
Expand Down Expand Up @@ -63,6 +65,11 @@ resource "aws_api_gateway_deployment" "api_gateway_deployment" {

depends_on = [
aws_api_gateway_rest_api.api_gateway_rest_api,
aws_api_gateway_resource.capability,
aws_api_gateway_method.capability,
aws_api_gateway_integration.capability,
aws_api_gateway_method_response.capability_200,
aws_api_gateway_integration_response.capability,
aws_api_gateway_integration_response.head_integration_response
]
}
Expand Down
37 changes: 37 additions & 0 deletions tests/features/producer/createDocumentReference-failure.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1044,3 +1044,40 @@ Feature: Producer - createDocumentReference - Failure Scenarios
"expression": ["DocumentReference"]
}
"""

Scenario: Custodian suffix is rejected with a .
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
And the organisation 'ANGY1' is authorised to access pointer types:
| system | value |
| http://snomed.info/sct | 736253002 |
When producer 'ANGY1' creates a DocumentReference with values:
| property | value |
| subject | 9999999999 |
| status | current |
| type | 736253002 |
| category | 734163000 |
| custodian | ANGY1.abcsuffix |
| author | HAR1 |
| url | https://example.org/my-doc.pdf |
Then the response status code is 422
And the response is an OperationOutcome with 1 issue
And the OperationOutcome contains the issue:
"""
{
"severity": "error",
"code": "business-rule",
"details": {
"coding": [
{
"system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1",
"code": "UNPROCESSABLE_ENTITY",
"display": "Unprocessable Entity"
}
]
},
"diagnostics": "The custodian of the provided DocumentReference does not match the expected ODS code for this organisation",
"expression": [
"custodian.identifier.value"
]
}
"""
3 changes: 0 additions & 3 deletions tests/smoke/scenarios/api_capability_statement_lookup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import pytest

from tests.utilities.api_clients import ConsumerTestClient, ProducerTestClient


@pytest.mark.skip(reason="Capability statements aren't working reliably at the minute")
def test_read_api_capability_statements(
consumer_client: ConsumerTestClient, producer_client: ProducerTestClient
):
Expand Down