Add contract tests for SDS FHIR API stub#147
Merged
Vox-Ben merged 7 commits intofeature/GPCAPIM-350_sds_stub_contract_testsfrom Apr 2, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/NHSDigital/clinical-data-gateway-api/sessions/2f2c1323-5612-4a91-8fa4-596ae1a54dc3 Co-authored-by: Vox-Ben <59649826+Vox-Ben@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add contract tests for SDS stub implementation
Add contract tests for SDS FHIR API stub
Mar 30, 2026
Contributor
|
@copilot tests/contract/stub/sds_stub_contract_tests.md has lots of trailing whitespace, please remove this. |
Agent-Logs-Url: https://github.com/NHSDigital/clinical-data-gateway-api/sessions/617138e2-3608-4bcd-8875-926a753af97d Co-authored-by: Vox-Ben <59649826+Vox-Ben@users.noreply.github.com>
Author
…hub.com/NHSDigital/clinical-data-gateway-api into copilot/add-contract-tests-for-sds-stub
Contributor
|
@copilot Please remove tests/contract/stub/sds_stub_contract_tests.md |
Agent-Logs-Url: https://github.com/NHSDigital/clinical-data-gateway-api/sessions/0a918165-a604-41c0-bcb3-18fd0ab10008 Co-authored-by: Vox-Ben <59649826+Vox-Ben@users.noreply.github.com>
Author
|
|
Deployment Complete
|
fa59278
into
feature/GPCAPIM-350_sds_stub_contract_tests
53 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The
SdsFhirApiStubhad no contract tests to verify it faithfully emulates the SDS OpenAPI spec. This adds a contract test suite.New files
tests/contract/stub/test_sds_stub_contract.py— 78 contract tests across 7 classes, calling stub methods directly and asserting on the returnedrequests.Responseobjects:TestGetDeviceBundleSuccessX-Correlation-Idecho, empty result for unknown orgTestGetDeviceResourceStructureid,identifierlist (ASID + party key),ownerwith ODS systemTestGetDeviceBundleValidationErrorsapikey,organization,identifier, missing interaction ID;OperationOutcomeshapeTestGetEndpointBundleSuccessorganization, empty result for unknown party keyTestGetEndpointResourceStructurestatus=active,connectionType,payloadType,address,managingOrganization, identifiersTestGetEndpointBundleValidationErrorsapikey/identifier;OperationOutcomeshapeTestGetConvenienceMethodget()URL routing (Device vs Endpoint), last-call metadata recording, error propagationTestUpsertOperationsupsert_device/clear_devices/upsert_endpoint/clear_endpointsround-tripsKey contract assertions
Original prompt
Created from VS Code via the GitHub Pull Request extension.