From f9f353c83ff5765bac0ffecdf8644ad36ddcdc09 Mon Sep 17 00:00:00 2001 From: eesa456 Date: Mon, 7 Jul 2025 22:09:38 +0100 Subject: [PATCH 1/5] NRL-753 add capability to depends on --- .../infrastructure/modules/api_gateway/api_gateway.tf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/terraform/infrastructure/modules/api_gateway/api_gateway.tf b/terraform/infrastructure/modules/api_gateway/api_gateway.tf index 40dca31cf..a4a39e4ff 100644 --- a/terraform/infrastructure/modules/api_gateway/api_gateway.tf +++ b/terraform/infrastructure/modules/api_gateway/api_gateway.tf @@ -60,7 +60,12 @@ resource "aws_api_gateway_deployment" "api_gateway_deployment" { } depends_on = [ - aws_api_gateway_rest_api.api_gateway_rest_api + 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 ] } From a02f3e252969a3b4e342f5e94e45e17070225eac Mon Sep 17 00:00:00 2001 From: eesa456 Date: Mon, 7 Jul 2025 22:23:55 +0100 Subject: [PATCH 2/5] NRL-753 add smoke test back --- tests/smoke/scenarios/api_capability_statement_lookup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/smoke/scenarios/api_capability_statement_lookup.py b/tests/smoke/scenarios/api_capability_statement_lookup.py index f21f15106..71959df30 100644 --- a/tests/smoke/scenarios/api_capability_statement_lookup.py +++ b/tests/smoke/scenarios/api_capability_statement_lookup.py @@ -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 ): From 4eb419145d908ca44493117645fac8d052a77272 Mon Sep 17 00:00:00 2001 From: eesa456 Date: Tue, 8 Jul 2025 09:44:05 +0100 Subject: [PATCH 3/5] NRL-753 add depends on to make sure method is made after resource --- terraform/infrastructure/modules/api_gateway/api_gateway.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/infrastructure/modules/api_gateway/api_gateway.tf b/terraform/infrastructure/modules/api_gateway/api_gateway.tf index a4a39e4ff..ec08a108c 100644 --- a/terraform/infrastructure/modules/api_gateway/api_gateway.tf +++ b/terraform/infrastructure/modules/api_gateway/api_gateway.tf @@ -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" { From 1a6b33a0c4ef35148677da449da9c5c02be3e88a Mon Sep 17 00:00:00 2001 From: eesa456 Date: Wed, 9 Jul 2025 14:49:43 +0100 Subject: [PATCH 4/5] NRL-791 add custodian suffix int test --- .../createDocumentReference-failure.feature | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/features/producer/createDocumentReference-failure.feature b/tests/features/producer/createDocumentReference-failure.feature index 6f064d065..ad35f9d8e 100644 --- a/tests/features/producer/createDocumentReference-failure.feature +++ b/tests/features/producer/createDocumentReference-failure.feature @@ -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" + ] + } + """ From a5848ff1b94312a9676722ece9e7994a5d71c39e Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 11 Jul 2025 09:47:50 +0100 Subject: [PATCH 5/5] NRL-753 remove test --- .../createDocumentReference-failure.feature | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/tests/features/producer/createDocumentReference-failure.feature b/tests/features/producer/createDocumentReference-failure.feature index ad35f9d8e..6f064d065 100644 --- a/tests/features/producer/createDocumentReference-failure.feature +++ b/tests/features/producer/createDocumentReference-failure.feature @@ -1044,40 +1044,3 @@ 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" - ] - } - """