Files

3.5 KiB

Architecture-dependent test adaptations

Authority: approval Q1. Unmodified originals remain under Reference/ArchitectureA. Functional assertions stay intact except explicitly approved architecture-dependent conditions below.

Original scenario / infrastructure B replacement / reason
PatientApiFixture / ObservationApiFixture: multiple hosts/two databases One real Kestrel host and one isolated database, module-owned schemas. Test-admin contexts remain available solely to establish Given and inspect persistence. Runtime uses restricted DML role
All adopted suites: service namespaces Module/shared immutable value namespaces; JSON expectation vocabulary preserved
RecordObservationTests.Failed_patient_lookup_is_rejected_without_saving StopPatientService helper now configures unusable shared DB endpoint; 502 assertion becomes approved 503; persisted count assertion unchanged
Guidance tests: ApiGateway host HealthApp host; all original instructions/source/applicability/side-effect assertions and upstream traps unchanged
ViewObservationContextTests / filtered access Empty denied 404 preserved, corrected implementation after tests caught accidental Problem Details
New concurrency checks Hold row lock, prove both patches wait, release, verify both disjoint changes and unchanged owner/time/note; new architecture obligation

Insight/context/trend/deletion-derived tests: service-stop helpers represent DB outage, expected 503 replaces 502; current data, no-write, no-false-insufficiency assertions unchanged. Pure calculation tests instantiate the identical mathematical implementation through its internal test-compatible entry and explicit Guidance reference catalog. No clinical assertion changed.

Additional original scenario B replacement / preserved obligations
HealthOverviewTests.Overview_service_credential_is_restricted_to_required_reads Sole edge rejects service-only headers with 401, replacing 403 from obsolete Service role. No protected data returned
HealthOverviewTests.Unavailable_source_or_overview_is_a_failure_not_absent_insight Each old service-stop example injects shared DB unavailability; 503 replaces 502. No false nullable-insight success
PatientAuthenticationTests.Direct_services_reject_client_tokens_missing_keys_and_forged_keys / Service_credentials_are_limited_to_their_documented_read_calls Replaced together by Sole_public_edge_accepts_client_ticket_but_service_headers_grant_no_access: valid client ticket works at sole edge, forged service headers grant nothing, internal by-account route absent. Originals remain baseline evidence. Patient/professional denial matrices unchanged
PatientAuthenticationTests.Database_failure_rolls_back_profile_and_association_together Same B-local trigger/no-row/retry assertions, search_path resolves owned Profile schema; unexpected write failure still 500
Original view/overview wire DTOs Same JSON fields. Shared context DTO nullable annotation needs test null-forgiving operator after established setup; assertions unchanged

| Original AuthenticationIntegrationTests replacement handler | Standard ASP.NET replacement scheme is now default at sole edge; test seeds real B-local Profile instead of HTTP PatientHandler. Own 200, other empty 404 assertions unchanged. Production HTTP rejection test retained | | MeasurementContextMigrationTests | Fresh schema given equivalent synthetic row and required associated patient; same original IDs/times/values/text/Unknown detail assertions. No old-schema/live import, per Q4 |