This project provides mapping files and test data for the GP Connect demonstrator, packaged in multiple formats for flexible hosting:
- Docker images (WireMock bundled with mappings & payloads)
- WireMock Cloud (mappings & payloads hosted in a managed Cloud instance)
- Native WireMock (standalone server with mappings & payloads)
Before you begin, ensure you have the following installed:
- Git (to clone this repo)
- Docker (for Docker-based usage only)
- Java 8+ (for native WireMock only)
- WireMock Cloud account (for Cloud-based usage only; sign up at https://cloud.wiremock.io)
Note: You only need Docker for Section 1, a WireMock Cloud account for Section 2, and Java for Section 3.
Use this mode if you want a self-contained container with WireMock, mappings, and payloads.
-
Clone the repository and switch to the release branch:
git clone https://github.com/NHSDigital/gpconnect-mock-tests.git cd gpconnect-mock-tests git checkout release/initial -
Locate the Docker archive in the
docker-images/folder (e.g.demonstrator-data-v0.7.4.tarordemonstrator-data-v1.5.tar). You can view this folder in your operating system’s file manager or via command line. -
Load the chosen image into Docker:
docker load -i docker-images/demonstrator-data-<VERSION>.tar
-
Run the WireMock container, setting any flags you require:
docker run --rm -it -p 8080:8080 -p 8443:8443 demonstrator-data-<VERSION> --root-dir /home/wiremock --port 8080 --https-port 8443 --verbose --local-response-templating
--root-dir– root directory containingmappings/and__files/--port/--https-port– bind HTTP/HTTPS ports--verbose– log full request/response details--local-response-templating– enable Handlebars templating
| Parameter | Description |
|---|---|
--rm |
Automatically remove the container once it stops. |
-it |
Allocate a pseudo-TTY and keep STDIN open, allowing interactive logs. |
-p 8080:8080 |
Map port 8080 in the container to port 8080 on the host, exposing the mock server. |
demonstrator-data-<VERSION> |
Docker image name and tag (matches the loaded archive). |
--verbose |
Enable detailed logging output from WireMock. |
--enable-browser |
Activate the WireMock browser-based UI for exploring mappings and requests. |
- Browse the WireMock UI at:
http://localhost:8080/__admin/swagger-ui/
Use this mode to host your stubs in WireMock’s managed Cloud service. You can import your project folder (which contains both mappings/ and __files/) directly via drag-and-drop, and WireMock Cloud will inline the response bodies.
- Log in to your WireMock Cloud account at https://www.wiremock.io/.
- Create a new instance and note the endpoint URL (e.g.
https://my-demo.cloud.wiremock.io). - Locate your project folder:
- In this repo, the folder
wiremock-mapping-files/V<MAJOR>-<MINOR>/is your WireMock project folder (it containsmappings/and__files/).
- In this repo, the folder
- Import via the Cloud UI:
- In your instance dashboard, click Import/Export in the left menu.
- Choose Import and select Mappings & Files.
- Drag and drop the project folder (
wiremock-mapping-files/V<MAJOR>-<MINOR>/) onto the dialog. - Confirm to import; response bodies under
__fileswill be inlined into the stub definitions.
- Verify your stubs under Stubs and test via the browser or API.
Use this mode to run WireMock locally without Docker.
-
Download the WireMock standalone JAR for your platform:
- In a web browser, navigate to:
https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/ - Click the folder for the desired version (e.g.
3.13.1). - In the selected version directory, click the
wiremock-standalone-<VERSION>.jarlink (e.g.wiremock-standalone-3.13.1.jar) to download. - Direct download example for v3.13.1:
https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/3.13.1/wiremock-standalone-3.13.1.jar
- In a web browser, navigate to:
-
Prepare a server directory:
- Create a folder named
wiremock-demo. - Copy the
mappingsand__filesfolders for your version from:intowiremock-mapping-files/V<MAJOR>-<MINOR>/mappings wiremock-mapping-files/V<MAJOR>-<MINOR>/__fileswiremock-demousing your OS file manager or command-line copy.
- Create a folder named
-
Start WireMock with common parameters:
java -jar wiremock-standalone-<VERSION>.jar --root-dir wiremock-demo --port 8080 --https-port 8443 --verbose --local-response-templating
--root-dir– point to yourwiremock-demodirectory--port/--https-port– choose desired ports--verbose– log detailed traffic to the console--local-response-templating– enable dynamic response templating
-
Access WireMock:
- UI Browser: http://localhost:8080/__admin/browser/
- Admin API: http://localhost:8080/__admin/mappings
Hit the mocked GP Connect endpoints using your tool of choice (cURL, Postman, etc.):
curl -X POST "http://localhost:8080/gpconnect-demonstrator/v0/fhir" -H "Accept: application/xml+fhir" -H "Ssp-TraceID: c9064589-6e18-471c-97bd-2fcd4bd7e749" -H "Ssp-From: 200000000985" -H "Ssp-To: 200000000985" -H "Ssp-InteractionId: urn:nhs:names:services:gpconnect:fhir:operation:gpc.getcarerecord" -H "Content-Type: application/json+fhir" --data '{ "resourceType": "Parameters", "parameter": [ { "name": "patientNHSNumber", "valueIdentifier": { "system": "http://fhir.nhs.net/Id/nhs-number", "value": "9658218873" } }, { "name": "recordSection", "valueCodeableConcept": { "coding": [ { "system": "http://fhir.nhs.net/ValueSet/gpconnect-record-section-1", "code": "CLI" } ] } } ] }'We welcome contributions! Please fork the repo, create a feature branch, and open a pull request against release/initial.
GPC Ping is a lightweight .NET console application designed to validate JWT tokens and provide diagnostic information. It serves as a simple validation tool that can be used to test connectivity and authentication within a GP Connect ecosystem.
- JWT Token Validation: Accepts and validates JWT tokens
- Informs the user which claims are valid and which are not (with brief reasons)
- Simple Command-line Interface: Run with
--versionand--tokenparameters
- Clone the repository pointing at branch
gpc-ping:
git clone -b gpc-ping https://github.com/nhsconnect/gpconnect-demonstrator.git- Navigate to the project directory:
cd gpconnect-demonstrator/gpc-ping- Build the application:
dotnet build -c Release- Run the application using either of the following methods:
dotnet run -- --version v0.7.4 --token <your-jwt-token>Be sure to include the
--separator before the app arguments.
./bin/Release/net9.0/gpc-ping.exe --version v0.7.4 --token <your-jwt-token>-
--version
Specify the GP Connect version (e.g.,v0.7.4,v1.2.7,v1.5.0,v1.6.0) -
--token
The raw JWT token string (not includingBearerprefix)
dotnet run -- --version v0.7.4 --token eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJpc3MiOiJodHRwcz...Or if running the built app:
./bin/Release/net9.0/gpc-ping.exe --version v0.7.4 --token eyJhbGciOiJub25lIiwidH...The Dockerfile can be found at tools/dockerfile/Dockerfile To build a new container do the following.
From the repo's base directory in a termiinal run the following commands. this will build and store in your local Docker image cache.
docker build -f tools/dockerfile/Dockerfile -t gpconnect-wiremock .you can see the image by running
docker imagesthen to save it as a file run
docker save -o gpconnect-wiremock.tar gpconnect-wiremockThat gives you a gpconnect-wiremock.tar you can move around.
The GP Connect mock test data includes a number of structured record test files where medications are referenced using SNOMED codes. These codes are tied to dm+d but can become outdated over time when products are replaced or discontinued. To ensure the tests remain accurate and representative, the SNOMED codes within these files should be reviewed and updated regularly.
The affected files are spread across multiple areas of the repository, including those for problems, consultations, and medications. Each of these JSON bundles contains medication entries where SNOMED codes are used, and several have already been flagged as needing updates.
Going forward, the action required is to check each test file for SNOMED-coded medication entries and replace any codes that have been retired or superseded with their current equivalents in dm+d. This will keep the mock tests aligned with live clinical systems and prevent test failures due to invalid or outdated coding.
-
Retrieve_Problems_structured_record_with_made_up_partParameter_expected_success-1_200_19b9c8.json
- Citalopram 20mg tablets
- Paracetamol 500mg tablets
-
Retrieve_problems_structured_record_for_a_patient_that_has_repeating_pair_values_expected_success-1_200_c40098.json
- Sertraline 100mg tablets
- Metformin 1g modified-release tablets
- Atorvastatin 20mg tablets
- Gliclazide 80mg tablets
- Lantus SoloStar insulin pens
-
Retrieve_problems_structured_record_with_significance_partParameter_expected_success-1_200_5d8635.json
- Citalopram 20mg tablets
- Paracetamol 500mg tablets
-
Retrieve_problems_structured_record_with_status_and_significance_partParameter_expected_success-1_200_0c4dfa.json
- Citalopram 20mg tablets
- Paracetamol 500mg tablets
-
Retrieve_problems_structured_record_with_status_partParameter_expected_success-1_200_fa395a.json
- Citalopram 20mg tablets
- Paracetamol 500mg tablets
-
Verify_response_for_a_Patient_with_Problems_linked_to_other_Problems-1_200_82755e.json
- Citalopram 20mg tablets
- Paracetamol 500mg tablets
-
Verify_response_for_a_Patient_with_Problems_linked_to_some_clinical_items-1_200_1b2757.json
- Citalopram 20mg tablets
- Paracetamol 500mg tablets
-
Retrieve_consultations_structured_record_with_endDate_value_only_expected_success-1_200_1e3fb3.json
- Citalopram 20mg tablets
- Paracetamol 500mg tablets
-
Verify_Consultations_Response_for_a_Patient_with_Topic_or_Headings_linked_to_clinical_items_and_a_problem-1_200_ba0a83.json
- Citalopram 20mg tablets
- Amlodipine 10mg tablets
- Paracetamol 500mg tablets
-
Verify_Consultations_structured_record_for_a_Patient_includeConsultation_and_consultationsMostRecent_partParameter-1_200_224634.json
- Citalopram 20mg tablets
- Amlodipine 10mg tablets
- Paracetamol 500mg tablets
-
Retrieve_the_medication_structured_record_for_a_patient_with_no_problems_and_excluding_prescription_issues-1_200_e118d2.json
- Tramadol 50mg capsules
-
Retrieve_the_medication_structured_record_for_a_patient_with_no_problems_and_excluding_prescription_issues-2_200_a57591.json
- Tramadol 50mg capsules
-
Retrieve_the_medication_structured_record_for_a_patient_with_no_problems_and_excluding_prescription_issues-3_200_43982b.json
- Transfer-degraded medication entry (record artifact)
-
Retrieve_the_medication_structured_record_for_a_patient_with_problems_linked_and_excluding_prescription_issues-1_200_b37f3c.json
- Sertraline 100mg tablets
- Metformin 1g modified-release tablets
- Atorvastatin 20mg tablets
- Gliclazide 80mg tablets
- Lantus SoloStar insulin pens
-
Retrieve_the_medication_structured_record_section_for_a_patient_with_a_timePeriod-1_200_1758df.json
- Sertraline 100mg tablets
- Metformin 1g modified-release tablets
- Atorvastatin 20mg tablets
- Gliclazide 80mg tablets
- Lantus SoloStar insulin pens
-
Retrieve_the_medication_structured_record_section_for_a_patient_with_medication_prescribed_elsewhere-1_200_dbbffb.json
- Transfer-degraded medication entry (record artifact)
-
Retrieve_the_medication_structured_record_section_for_a_patient_with_no_problems_and_including_prescription_issues-1_200_02c0a0.json
- Lantus SoloStar insulin pens
-
Retrieve_the_medication_structured_record_section_for_a_patient_with_no_problems_and_including_prescription_issues-2_200_9d28a1.json
- Tramadol 50mg capsules
-
Retrieve_the_medication_structured_record_section_for_a_patient_with_no_problems_and_including_prescription_issues-3_200_042240.json
- Transfer-degraded medication entry (record artifact)
-
Retrieve_the_medication_structured_record_section_for_a_patient_with_problems_linked_and_including_prescription_issues-1_200_b56138.json
- Sertraline 100mg tablets
- Metformin 1g modified-release tablets
- Atorvastatin 20mg tablets
- Gliclazide 80mg tablets
- Lantus SoloStar insulin pens
- Structured_request_sent_with_valid_partParameter_for_includeAllergies_and_without_includeMedications_-_expected_success-1_200_934eaa.json
- Sertraline 100mg tablets
- Metformin 1g modified-release tablets
- Atorvastatin 20mg tablets
- Gliclazide 80mg tablets
- Lantus SoloStar insulin pens
MIT
- amendPostmanCollection.py to validate response http status and deep compare of response json