Add API integration test coverage for all TRN request endpoint versions#3250
Merged
Add API integration test coverage for all TRN request endpoint versions#3250
Conversation
417995f to
0d67960
Compare
Member
Author
|
@copilot ensure there is integration test coverage for the CreateTrnRequest and GetTrnRequest API operations for versions 20240307 and 20240606. Use the tests in this PR as a base. |
…40307 and v20240606 Agent-Logs-Url: https://github.com/DFE-Digital/teaching-record-system/sessions/ad017441-9971-4bcd-900b-15fe9a6820ea Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>
Contributor
Done in commit 3de4f56. Uncommented and updated the integration tests for Key differences handled per version:
|
hortha
approved these changes
Apr 1, 2026
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.
Context
Integration tests for the
CreateTrnRequestandGetTrnRequestAPI operations were missing for versions20240307and20240606. The test files existed but were entirely commented out, as they referenced the old CRM-based implementation (XrmFakedContext, CrmQueryDispatcherSpy,.WithTrn(),.WithEmail(), etc.) which is no longer used.Changes proposed in this pull request
CreateTrnRequestandGetTrnRequestfor API versions20240307,20240606,20250203, and20250425, replacing obsolete CRM-based test code with the current Postgres/EF Core-based approach.Version-specific behaviour covered:
Emailfield; response includes apersonobject (firstName,middleName,lastName,email,dateOfBirth,nationalInsuranceNumber) — nopotentialDuplicateoraccessYourTeachingQualificationsLink.EmailAddresseslist; response is{requestId, status, trn}only — nopersonobject,potentialDuplicate, oraccessYourTeachingQualificationsLink.EmailAddresseslist; response is{requestId, status, trn}.EmailAddresseslist; response includes{requestId, status, trn, potentialDuplicate, accessYourTeachingQualificationsLink}.Each version's tests cover: permission checks, request validation (invalid ID, ID length, date of birth, NINO), conflict detection, and happy-path completed/pending responses.
Guidance to review
Tests follow the same patterns as the existing V20250203 and V20250425 tests. Each version's
TestBasesets theX-Api-Versionheader so requests are routed to the correct controller.Checklist