From 9882a1cd58065bf90f2d9ef011d99ffe7acbb779 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 24 May 2022 17:37:45 -0400 Subject: [PATCH 1/6] adding smoke test files --- .../smoketestfiles/patient_batch_create.json | 85 +++++++ .../smoketestfiles/patient_create.json | 162 +++++++++++++ .../smoketestfiles/patient_patch.json | 7 + .../patient_process_message.json | 63 +++++ .../smoketestfiles/patient_update.json | 20 ++ src/test/smoketest/SMOKE_TEST.md | 10 + src/test/smoketest/http-client.env.json | 7 + src/test/smoketest/plain_server.rest | 223 ++++++++++++++++++ 8 files changed, 577 insertions(+) create mode 100644 src/test/resources/smoketestfiles/patient_batch_create.json create mode 100644 src/test/resources/smoketestfiles/patient_create.json create mode 100644 src/test/resources/smoketestfiles/patient_patch.json create mode 100644 src/test/resources/smoketestfiles/patient_process_message.json create mode 100644 src/test/resources/smoketestfiles/patient_update.json create mode 100644 src/test/smoketest/SMOKE_TEST.md create mode 100644 src/test/smoketest/http-client.env.json create mode 100644 src/test/smoketest/plain_server.rest diff --git a/src/test/resources/smoketestfiles/patient_batch_create.json b/src/test/resources/smoketestfiles/patient_batch_create.json new file mode 100644 index 0000000..c476f72 --- /dev/null +++ b/src/test/resources/smoketestfiles/patient_batch_create.json @@ -0,0 +1,85 @@ +{ + "resourceType": "Bundle", + "id": "bundle-transaction", + "meta": { + "lastUpdated": "2014-08-18T01:43:30Z" + }, + "type": "transaction", + "entry": [ + { + "resource": { + "resourceType": "Patient", + "text": { + "status": "generated", + "div": "
Some narrative
" + }, + "active": true, + "name": [ + { + "use": "official", + "family": "Iantorno", + "given": [ + "Mark" + ] + } + ], + "gender": "male", + "birthDate": "1983-06-23" + }, + "request": { + "method": "POST", + "url": "Patient" + } + }, + { + "resource": { + "resourceType": "Patient", + "text": { + "status": "generated", + "div": "
Some narrative
" + }, + "active": true, + "name": [ + { + "use": "official", + "family": "Iantorno", + "given": [ + "Alexander" + ] + } + ], + "gender": "male", + "birthDate": "1993-08-16" + }, + "request": { + "method": "POST", + "url": "Patient" + } + }, + { + "resource": { + "resourceType": "Patient", + "text": { + "status": "generated", + "div": "
Some narrative
" + }, + "active": true, + "name": [ + { + "use": "official", + "family": "Cash", + "given": [ + "Johnny" + ] + } + ], + "gender": "male", + "birthDate": "1932-02-26" + }, + "request": { + "method": "POST", + "url": "Patient" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/smoketestfiles/patient_create.json b/src/test/resources/smoketestfiles/patient_create.json new file mode 100644 index 0000000..73f5899 --- /dev/null +++ b/src/test/resources/smoketestfiles/patient_create.json @@ -0,0 +1,162 @@ +{ + "resourceType": "Patient", + "id": "example", + "text": { + "status": "generated", + "div": "
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
NamePeter James \n Chalmers ("Jim")\n
Address534 Erewhon, Pleasantville, Vic, 3999
ContactsHome: unknown. Work: (03) 5555 6473
IdMRN: 12345 (Acme Healthcare)
\n\t\t
" + }, + "identifier": [ + { + "use": "usual", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "MR" + } + ] + }, + "system": "urn:oid:1.2.36.146.595.217.0.1", + "value": "12345", + "period": { + "start": "2001-05-06" + }, + "assigner": { + "display": "Acme Healthcare" + } + } + ], + "active": true, + "name": [ + { + "use": "official", + "family": "Chalmers", + "given": [ + "Peter", + "James" + ] + }, + { + "use": "usual", + "given": [ + "Jim" + ] + }, + { + "use": "maiden", + "family": "Windsor", + "given": [ + "Peter", + "James" + ], + "period": { + "end": "2002" + } + } + ], + "telecom": [ + { + "use": "home" + }, + { + "system": "phone", + "value": "(03) 5555 6473", + "use": "work", + "rank": 1 + }, + { + "system": "phone", + "value": "(03) 3410 5613", + "use": "mobile", + "rank": 2 + }, + { + "system": "phone", + "value": "(03) 5555 8834", + "use": "old", + "period": { + "end": "2014" + } + } + ], + "gender": "male", + "birthDate": "1974-12-25", + "_birthDate": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthTime", + "valueDateTime": "1974-12-25T14:35:45-05:00" + } + ] + }, + "deceasedBoolean": false, + "address": [ + { + "use": "home", + "type": "both", + "text": "534 Erewhon St PeasantVille, Rainbow, Vic 3999", + "line": [ + "534 Erewhon St" + ], + "city": "PleasantVille", + "district": "Rainbow", + "state": "Vic", + "postalCode": "3999", + "period": { + "start": "1974-12-25" + } + } + ], + "contact": [ + { + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "N" + } + ] + } + ], + "name": { + "family": "du Marché", + "_family": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix", + "valueString": "VV" + } + ] + }, + "given": [ + "Bénédicte" + ] + }, + "telecom": [ + { + "system": "phone", + "value": "+33 (237) 998327" + } + ], + "address": { + "use": "home", + "type": "both", + "line": [ + "534 Erewhon St" + ], + "city": "PleasantVille", + "district": "Rainbow", + "state": "Vic", + "postalCode": "3999", + "period": { + "start": "1974-12-25" + } + }, + "gender": "female", + "period": { + "start": "2012" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/smoketestfiles/patient_patch.json b/src/test/resources/smoketestfiles/patient_patch.json new file mode 100644 index 0000000..b1cfaaa --- /dev/null +++ b/src/test/resources/smoketestfiles/patient_patch.json @@ -0,0 +1,7 @@ +[ + { + "op": "add", + "path": "/active", + "value": false + } +] \ No newline at end of file diff --git a/src/test/resources/smoketestfiles/patient_process_message.json b/src/test/resources/smoketestfiles/patient_process_message.json new file mode 100644 index 0000000..033f3cf --- /dev/null +++ b/src/test/resources/smoketestfiles/patient_process_message.json @@ -0,0 +1,63 @@ +{ + "resourceType": "MessageHeader", + "id": "{{batch_patient_id}}", + "text": { + "status": "generated", + "div": "
\n\t\t\t

Update Person resource for Peter James CHALMERS (Jim), MRN: 12345 (Acme Healthcare)

\n\t\t
" + }, + "eventCoding": { + "system": "http://example.org/fhir/message-events", + "code": "admin-notify" + }, + "destination": [ + { + "name": "Acme Message Gateway", + "target": { + "reference": "Device/example" + }, + "endpoint": "llp:10.11.12.14:5432", + "receiver": { + "reference": "http://acme.com/ehr/fhir/Practitioner/2323-33-4" + } + } + ], + "sender": { + "reference": "Organization/1" + }, + "enterer": { + "reference": "Practitioner/example" + }, + "author": { + "reference": "Practitioner/example" + }, + "source": { + "name": "Acme Central Patient Registry", + "software": "FooBar Patient Manager", + "version": "3.1.45.AABB", + "contact": { + "system": "phone", + "value": "+1 (555) 123 4567" + }, + "endpoint": "llp:10.11.12.13:5432" + }, + "reason": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/message-reasons-encounter", + "code": "admit" + } + ] + }, + "response": { + "identifier": { + "value": "5015fe84-8e76-4526-89d8-44b322e8d4fb" + }, + "code": "ok" + }, + "focus": [ + { + "reference": "Patient/example" + } + ], + "definition": "http:////acme.com/ehr/fhir/messagedefinition/patientrequest" +} \ No newline at end of file diff --git a/src/test/resources/smoketestfiles/patient_update.json b/src/test/resources/smoketestfiles/patient_update.json new file mode 100644 index 0000000..b182b2f --- /dev/null +++ b/src/test/resources/smoketestfiles/patient_update.json @@ -0,0 +1,20 @@ +{ + "resourceType": "Patient", + "id": "{{batch_patient_id}}", + "text": { + "status": "generated", + "div": "
Some narrative
" + }, + "active": true, + "name": [ + { + "use": "official", + "family": "Iantoryes", + "given": [ + "Mark" + ] + } + ], + "gender": "male", + "birthDate": "1983-06-23" +} diff --git a/src/test/smoketest/SMOKE_TEST.md b/src/test/smoketest/SMOKE_TEST.md new file mode 100644 index 0000000..3370613 --- /dev/null +++ b/src/test/smoketest/SMOKE_TEST.md @@ -0,0 +1,10 @@ +# JPA Server Starter Smoke Tests + +--- + +### What they do... +When updating the HAPI-FHIR version, or making changes to the JPA server starter code itself, + +### Requirements... + +### How to run the smoke test... diff --git a/src/test/smoketest/http-client.env.json b/src/test/smoketest/http-client.env.json new file mode 100644 index 0000000..85b8ef4 --- /dev/null +++ b/src/test/smoketest/http-client.env.json @@ -0,0 +1,7 @@ +{ + "default": { + "host": "localhost:8080", + "username": "username", + "password": "password" + } +} \ No newline at end of file diff --git a/src/test/smoketest/plain_server.rest b/src/test/smoketest/plain_server.rest new file mode 100644 index 0000000..47e1515 --- /dev/null +++ b/src/test/smoketest/plain_server.rest @@ -0,0 +1,223 @@ +### Create Single Patient +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#create-type +POST http://{{host}}/fhir/Patient +Content-Type: application/json + +< ../resources/smoketestfiles/patient_create.json + +> {% + client.test("Patient created successfully", function() { + client.assert(response.status === 201, "Response status is not 201"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is Patient", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "Patient", "Expected 'Patient' but received '" + resourceType + "'"); + }); + client.global.set("single_patient_id", response.body.id); + client.global.set("single_patient_family_name", response.body.name[0].family); +%} + +### Search Single Patient +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#search +GET http://{{host}}/fhir/Patient?name={{single_patient_family_name}}&_id={{single_patient_id}} + +> {% + client.test("Patient created successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is Bundle", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "Bundle", "Expected 'Bundle' but received '" + resourceType + "'"); + }); + client.test("Total patients found is 1", function() { + const totalFound = response.body.total; + client.assert(totalFound === 1, "Expected '1' match but found '" + totalFound + "'"); + }); + %} + +### Delete Patient +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#delete-instance +DELETE http://{{host}}/fhir/Patient/{{single_patient_id}} + +> {% + client.test("Patient deleted successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is OperationOutcome", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "OperationOutcome", "Expected 'OperationOutcome' but received '" + resourceType + "'"); + }); +%} + +### Batch Patient Create +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#transaction-server +POST http://{{host}}/fhir/ +Content-Type: application/json + +< ../resources/smoketestfiles/patient_batch_create.json + +> {% + client.test("Bundle transaction completed successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is Bundle", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "Bundle", "Expected 'Bundle' but received '" + resourceType + "'"); + }); + client.test("All patient additions successful", function() { + for (var index = 0; index < response.body.entry.length; index++) { + client.assert(response.body.entry[index].response.status === "201 Created", "Expected '201 Created' for patient index " + index + " but received '" + response.body.entry[index].response.status + "'"); + } + }); + const batch_patient_location = response.body.entry[0].response.location; + const indexOfHistory = batch_patient_location.lastIndexOf("/_history"); + trimmed_location = batch_patient_location.substring(0, indexOfHistory); + trimmed_location = trimmed_location.replace("Patient/", "") + client.global.set("batch_patient_id", trimmed_location); +%} + +### Update - Instance +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#update-instance +PUT http://{{host}}/fhir/Patient/{{batch_patient_id}} +Content-Type: application/json + +< ../resources/smoketestfiles/patient_update.json + +> {% + client.test("Bundle transaction completed successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is Patient", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "Patient", "Expected 'Patient' but received '" + resourceType + "'"); + }); + client.test("Test last name updated", function() { + const familyName = response.body.name[0].family; + client.assert(familyName === "Iantoryes", "Expected updated family name 'Iantoryes' but received '" + familyName + "'"); + }); + client.test("Test version number updated", function() { + const versionId = response.body.meta.versionId; + client.assert(versionId === "2", "Expected updated versionId name '2' but received '" + versionId + "'"); + }); +%} + +### Patch - Instance +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#patch-instance +PATCH http://{{host}}/fhir/Patient/{{batch_patient_id}} +Content-Type: application/json-patch+json + +< ../resources/smoketestfiles/patient_patch.json + +> {% + client.test("Patch operation completed successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is Patient", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "Patient", "Expected 'Patient' but received '" + resourceType + "'"); + }); + client.test("Test active field patched", function() { + const active = response.body.active; + client.assert(active === false, "Expected updated active 'false' but received '" + active + "'"); + }); +%} + +### History - Server/Type/Instance +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#history-servertypeinstance +GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/_history + +> {% + client.test("History completed successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is Bundle", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "Bundle", "Expected 'Bundle' but received '" + resourceType + "'"); + }); + client.test("Test receive history type", function() { + const type = response.body.type; + client.assert(type === "history", "Expected type 'history' but received '" + type + "'"); + }); +%} + +### Capability Statement +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#capability-statement-metadata-server +GET http://{{host}}/fhir/metadata + +> {% + client.test("CapabilityStatement fetched successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is CapabilityStatement", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "CapabilityStatement", "Expected 'CapabilityStatement' but received '" + resourceType + "'"); + }); +%} + +### Extended Operations - everything +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#extended-operations +GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/$everything + +> {% + client.test("$everything operation successful", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is Bundle", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "Bundle", "Expected 'Bundle' but received '" + resourceType + "'"); + }); +%} + +### Extended Operations - validate +# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#extended-operations +POST http://{{host}}/fhir/Patient/{{batch_patient_id}}/$validate + +> {% + client.test("$validate operation successful", function() { + client.assert(response.status === 200, "Response status is not 200"); + }); + client.test("Response content-type is json", function() { + const type = response.contentType.mimeType; + client.assert(type === "application/fhir+json", "Expected 'application/fhir+json' but received '" + type + "'"); + }); + client.test("Response resourceType is OperationOutcome", function() { + const resourceType = response.body.resourceType; + client.assert(resourceType === "OperationOutcome", "Expected 'OperationOutcome' but received '" + resourceType + "'"); + }); +%} \ No newline at end of file From 067c7f16c4f450599e088b7a30f4cb50475495ad Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 24 May 2022 19:18:07 -0400 Subject: [PATCH 2/6] adding base documentation --- src/test/smoketest/SMOKE_TEST.md | 52 +++++++++++++++++-- src/test/smoketest/plain_server.rest | 30 +++++------ .../smoketestfiles/patient_batch_create.json | 0 .../smoketestfiles/patient_create.json | 0 .../smoketestfiles/patient_patch.json | 0 .../patient_process_message.json | 0 .../smoketestfiles/patient_update.json | 0 7 files changed, 63 insertions(+), 19 deletions(-) rename src/test/{resources => smoketest}/smoketestfiles/patient_batch_create.json (100%) rename src/test/{resources => smoketest}/smoketestfiles/patient_create.json (100%) rename src/test/{resources => smoketest}/smoketestfiles/patient_patch.json (100%) rename src/test/{resources => smoketest}/smoketestfiles/patient_process_message.json (100%) rename src/test/{resources => smoketest}/smoketestfiles/patient_update.json (100%) diff --git a/src/test/smoketest/SMOKE_TEST.md b/src/test/smoketest/SMOKE_TEST.md index 3370613..577e685 100644 --- a/src/test/smoketest/SMOKE_TEST.md +++ b/src/test/smoketest/SMOKE_TEST.md @@ -2,9 +2,53 @@ --- -### What they do... -When updating the HAPI-FHIR version, or making changes to the JPA server starter code itself, +When updating the supporting HAPI-FHIR version, or making changes to the JPA server starter code itself, it is sometimes +useful to run basic smoke tests to ensure the basic functionality of the server is maintained. The goal of these tests is +to provide users a quick way to run groups of tests that correspond to various sections within the +[HAPI-FHIR documentation][Link-HAPI-FHIR-docs]. -### Requirements... +### Requirements +Tests are written in IntelliJ [HTTP Client Request files][Link-HTTP-Client-Req-Intro]. Ultimate edition of IntelliJ +is required to run these tests. -### How to run the smoke test... +For more details on integrated tooling and request syntax, there is [documentation available][Link-HTTP-Client-Req-Exploring] +on the jetbrains website, in addition to the [API reference][Link-HTTP-Client-Req-API]. + +### Formatting +As mentioned, each test file corresponds to a given section within the hapifhir documentation as close as possible. For +example, there is a `plain_server.rest` file, which attemps to smoke test all basic functionality outlined in the section +[within the docs][Link-HAPI-FHIR-docs-plain-server]. + +Individual tests are formatted as follows: +```javascript +### Test Title Here +# +REST-OPERATION ENDPOINT-URL +// Verification Steps +``` + +Users can setup custom environment variables for running tests locally against their own servers. This can be done by +adding environment information within the `http-client.env.json` file. By default, we provide the following: +```json +{ + "default": { + "host": "localhost:8080", + "username": "username", + "password": "password" + } +} +``` + +### Running the Tests +Within IntelliJ, right click the file you wish to run tests in and select the `Run All` option from the menu. + +**Important:** Tests may not work individually when run. Often times, tests need to be run sequentially, as they depend +on resources/references from previous tests to complete. _(An example of this would be adding a Patient, saving the id, +then using that idea to test if we can successfully PATCH that Patient resource.)_ + + +[Link-HAPI-FHIR-docs]: https://hapifhir.io/hapi-fhir/docs/ +[Link-HAPI-FHIR-docs-plain-server]: https://hapifhir.io/hapi-fhir/docs/server_plain/server_types.html +[Link-HTTP-Client-Req-Intro]: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html +[Link-HTTP-Client-Req-Exploring]: https://www.jetbrains.com/help/idea/exploring-http-syntax.html +[Link-HTTP-Client-Req-API]: https://www.jetbrains.com/help/idea/http-response-handling-api-reference.html \ No newline at end of file diff --git a/src/test/smoketest/plain_server.rest b/src/test/smoketest/plain_server.rest index 47e1515..c5856ff 100644 --- a/src/test/smoketest/plain_server.rest +++ b/src/test/smoketest/plain_server.rest @@ -1,9 +1,9 @@ ### Create Single Patient -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#create-type +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#type_create POST http://{{host}}/fhir/Patient Content-Type: application/json -< ../resources/smoketestfiles/patient_create.json +< smoketestfiles/patient_create.json > {% client.test("Patient created successfully", function() { @@ -22,11 +22,11 @@ Content-Type: application/json %} ### Search Single Patient -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#search +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#type_search GET http://{{host}}/fhir/Patient?name={{single_patient_family_name}}&_id={{single_patient_id}} > {% - client.test("Patient created successfully", function() { + client.test("Patient search successful", function() { client.assert(response.status === 200, "Response status is not 200"); }); client.test("Response content-type is json", function() { @@ -44,7 +44,7 @@ GET http://{{host}}/fhir/Patient?name={{single_patient_family_name}}&_id={{singl %} ### Delete Patient -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#delete-instance +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#instance_delete DELETE http://{{host}}/fhir/Patient/{{single_patient_id}} > {% @@ -62,11 +62,11 @@ DELETE http://{{host}}/fhir/Patient/{{single_patient_id}} %} ### Batch Patient Create -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#transaction-server +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#system_transaction POST http://{{host}}/fhir/ Content-Type: application/json -< ../resources/smoketestfiles/patient_batch_create.json +< smoketestfiles/patient_batch_create.json > {% client.test("Bundle transaction completed successfully", function() { @@ -93,11 +93,11 @@ Content-Type: application/json %} ### Update - Instance -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#update-instance +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#instance_update PUT http://{{host}}/fhir/Patient/{{batch_patient_id}} Content-Type: application/json -< ../resources/smoketestfiles/patient_update.json +< smoketestfiles/patient_update.json > {% client.test("Bundle transaction completed successfully", function() { @@ -122,11 +122,11 @@ Content-Type: application/json %} ### Patch - Instance -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#patch-instance +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#instance-level-patch PATCH http://{{host}}/fhir/Patient/{{batch_patient_id}} Content-Type: application/json-patch+json -< ../resources/smoketestfiles/patient_patch.json +< smoketestfiles/patient_patch.json > {% client.test("Patch operation completed successfully", function() { @@ -147,7 +147,7 @@ Content-Type: application/json-patch+json %} ### History - Server/Type/Instance -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#history-servertypeinstance +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#history GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/_history > {% @@ -169,7 +169,7 @@ GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/_history %} ### Capability Statement -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#capability-statement-metadata-server +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#system_capabilities GET http://{{host}}/fhir/metadata > {% @@ -187,7 +187,7 @@ GET http://{{host}}/fhir/metadata %} ### Extended Operations - everything -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#extended-operations +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_operations.html GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/$everything > {% @@ -205,7 +205,7 @@ GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/$everything %} ### Extended Operations - validate -# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#extended-operations +# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_operations.html POST http://{{host}}/fhir/Patient/{{batch_patient_id}}/$validate > {% diff --git a/src/test/resources/smoketestfiles/patient_batch_create.json b/src/test/smoketest/smoketestfiles/patient_batch_create.json similarity index 100% rename from src/test/resources/smoketestfiles/patient_batch_create.json rename to src/test/smoketest/smoketestfiles/patient_batch_create.json diff --git a/src/test/resources/smoketestfiles/patient_create.json b/src/test/smoketest/smoketestfiles/patient_create.json similarity index 100% rename from src/test/resources/smoketestfiles/patient_create.json rename to src/test/smoketest/smoketestfiles/patient_create.json diff --git a/src/test/resources/smoketestfiles/patient_patch.json b/src/test/smoketest/smoketestfiles/patient_patch.json similarity index 100% rename from src/test/resources/smoketestfiles/patient_patch.json rename to src/test/smoketest/smoketestfiles/patient_patch.json diff --git a/src/test/resources/smoketestfiles/patient_process_message.json b/src/test/smoketest/smoketestfiles/patient_process_message.json similarity index 100% rename from src/test/resources/smoketestfiles/patient_process_message.json rename to src/test/smoketest/smoketestfiles/patient_process_message.json diff --git a/src/test/resources/smoketestfiles/patient_update.json b/src/test/smoketest/smoketestfiles/patient_update.json similarity index 100% rename from src/test/resources/smoketestfiles/patient_update.json rename to src/test/smoketest/smoketestfiles/patient_update.json From 8d6247bfe8357f0769ff7478e3533ed765006bae Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 24 May 2022 19:20:13 -0400 Subject: [PATCH 3/6] wip --- src/test/smoketest/SMOKE_TEST.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/smoketest/SMOKE_TEST.md b/src/test/smoketest/SMOKE_TEST.md index 577e685..3610e6f 100644 --- a/src/test/smoketest/SMOKE_TEST.md +++ b/src/test/smoketest/SMOKE_TEST.md @@ -44,7 +44,8 @@ Within IntelliJ, right click the file you wish to run tests in and select the `R **Important:** Tests may not work individually when run. Often times, tests need to be run sequentially, as they depend on resources/references from previous tests to complete. _(An example of this would be adding a Patient, saving the id, -then using that idea to test if we can successfully PATCH that Patient resource.)_ +then using that saved id to test if we can successfully PATCH that Patient resource. Without that saved id from the +previous test creating that patient, the PATCH test will fail.)_ [Link-HAPI-FHIR-docs]: https://hapifhir.io/hapi-fhir/docs/ From b71880e39ea06392a0a9aefdf40bc2621831dbef Mon Sep 17 00:00:00 2001 From: Mark Iantorno Date: Wed, 25 May 2022 12:55:16 -0400 Subject: [PATCH 4/6] Update src/test/smoketest/SMOKE_TEST.md Co-authored-by: Ken Stevens --- src/test/smoketest/SMOKE_TEST.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/smoketest/SMOKE_TEST.md b/src/test/smoketest/SMOKE_TEST.md index 3610e6f..5f79825 100644 --- a/src/test/smoketest/SMOKE_TEST.md +++ b/src/test/smoketest/SMOKE_TEST.md @@ -15,7 +15,7 @@ For more details on integrated tooling and request syntax, there is [documentati on the jetbrains website, in addition to the [API reference][Link-HTTP-Client-Req-API]. ### Formatting -As mentioned, each test file corresponds to a given section within the hapifhir documentation as close as possible. For +Each test file corresponds to a given section within the hapifhir documentation as close as possible. For example, there is a `plain_server.rest` file, which attemps to smoke test all basic functionality outlined in the section [within the docs][Link-HAPI-FHIR-docs-plain-server]. From 788015f467b91c9fb5dfaf043a7a4edd21553f94 Mon Sep 17 00:00:00 2001 From: Mark Iantorno Date: Wed, 25 May 2022 12:55:22 -0400 Subject: [PATCH 5/6] Update src/test/smoketest/SMOKE_TEST.md Co-authored-by: Ken Stevens --- src/test/smoketest/SMOKE_TEST.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/smoketest/SMOKE_TEST.md b/src/test/smoketest/SMOKE_TEST.md index 5f79825..7ced8ca 100644 --- a/src/test/smoketest/SMOKE_TEST.md +++ b/src/test/smoketest/SMOKE_TEST.md @@ -2,8 +2,7 @@ --- -When updating the supporting HAPI-FHIR version, or making changes to the JPA server starter code itself, it is sometimes -useful to run basic smoke tests to ensure the basic functionality of the server is maintained. The goal of these tests is +When updating the supporting HAPI-FHIR version, or making changes to the JPA server starter code itself, it is recommended to run basic smoke tests to ensure the basic functionality of the server is maintained. The goal of these tests is to provide users a quick way to run groups of tests that correspond to various sections within the [HAPI-FHIR documentation][Link-HAPI-FHIR-docs]. From e9ff226750d5ac335d46bbddad1bdaa6a3baa935 Mon Sep 17 00:00:00 2001 From: Mark Iantorno Date: Wed, 25 May 2022 12:55:41 -0400 Subject: [PATCH 6/6] Update src/test/smoketest/SMOKE_TEST.md Co-authored-by: Ken Stevens --- src/test/smoketest/SMOKE_TEST.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/smoketest/SMOKE_TEST.md b/src/test/smoketest/SMOKE_TEST.md index 7ced8ca..968d7fb 100644 --- a/src/test/smoketest/SMOKE_TEST.md +++ b/src/test/smoketest/SMOKE_TEST.md @@ -26,8 +26,7 @@ REST-OPERATION ENDPOINT-URL // Verification Steps ``` -Users can setup custom environment variables for running tests locally against their own servers. This can be done by -adding environment information within the `http-client.env.json` file. By default, we provide the following: +To run these tests against a specific server, configure the server details within the `http-client.env.json` file. By default, we provide the following: ```json { "default": {