diff --git a/e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/e2e/ConsolidatedSummaryTest.groovy b/e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/e2e/ConsolidatedSummaryTest.groovy index 9e3d95596..369aa0490 100644 --- a/e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/e2e/ConsolidatedSummaryTest.groovy +++ b/e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/e2e/ConsolidatedSummaryTest.groovy @@ -34,7 +34,7 @@ class ConsolidatedSummaryTest extends Specification { jsonBody.get((jsonBody.keySet().toArray())[0]).status != null } - def "consolidated endpoint failes when called while not authenticated"() { + def "consolidated endpoint fails when called while not authenticated"() { when: def consolidatedResponse = ConsolidatedSummaryClient.get("test", false) def parsedJsonBody = JsonParsing.parseContent(consolidatedResponse) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/EtorDomainRegistrationTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/EtorDomainRegistrationTest.groovy index 4c68faf54..a62678b52 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/EtorDomainRegistrationTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/EtorDomainRegistrationTest.groovy @@ -493,6 +493,7 @@ class EtorDomainRegistrationTest extends Specification { 1 * mockResponseHelper.constructOkResponse(expectedResultMap) >> new DomainResponse(expectedStatusCode) } + def "Consolidated metadata endpoint fails with a 500"() { given: def expectedStatusCode = 500 diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/database/PostgresDaoTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/database/PostgresDaoTest.groovy index 4570e6e29..48946200a 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/database/PostgresDaoTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/database/PostgresDaoTest.groovy @@ -277,6 +277,7 @@ class PostgresDaoTest extends Specification { TestApplicationContext.register(SqlDriverManager, mockDriver) TestApplicationContext.injectRegisteredImplementations() + when: def actual = PostgresDao.getInstance().fetchMetadataForSender("sender") diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/localfile/FilePartnerMetadataStorageTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/localfile/FilePartnerMetadataStorageTest.groovy index cda1f8e45..94cf00a6f 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/localfile/FilePartnerMetadataStorageTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/localfile/FilePartnerMetadataStorageTest.groovy @@ -88,6 +88,7 @@ class FilePartnerMetadataStorageTest extends Specification { def sender = "same_sender" PartnerMetadata metadata2 = new PartnerMetadata("abcdefghi", null, sender, null, null, null, null, null) PartnerMetadata metadata1 = new PartnerMetadata("123456789", null, sender, null, null, null, null, null) + TestApplicationContext.register(Formatter, Jackson.getInstance()) TestApplicationContext.injectRegisteredImplementations() diff --git a/operations/locustfile.py b/operations/locustfile.py index 60b335c63..772a48360 100644 --- a/operations/locustfile.py +++ b/operations/locustfile.py @@ -13,6 +13,7 @@ DEMOGRAPHICS_ENDPOINT = "/v1/etor/demographics" ORDERS_ENDPOINT = "/v1/etor/orders" METADATA_ENDPOINT = "/v1/etor/metadata" +CONSOLIDATED_ENDPOINT = "/v1/etor/metadata/summary" demographics_request_body = None order_request_body = None @@ -32,6 +33,7 @@ def on_start(self): self.submission_id = str(uuid.uuid4()) self.orders_api_called = False + self.sender = "flexion.simulated-hospital" # Start the token refreshing thread threading.Thread( @@ -74,7 +76,7 @@ def post_v1_etor_orders(self): if response.status_code == 200: self.orders_api_called = True - @task(2) + @task(1) def get_v1_etor_metadata(self): if self.orders_api_called: self.client.get( @@ -82,6 +84,14 @@ def get_v1_etor_metadata(self): headers={"Authorization": self.access_token}, ) + # @task(1) + # def get_v1_metadata_consolidated(self): + # if self.orders_api_called: + # self.client.get( + # f"{CONSOLIDATED_ENDPOINT}/{self.sender}", + # headers={"Authorization": self.access_token}, + # ) + @events.test_start.add_listener def test_start(environment): @@ -124,11 +134,11 @@ def get_auth_request_body(): def get_demographics_request_body(): # read the sample request body for the demographics endpoint - with open("examples/fhir/newborn_patient.json", "r") as f: + with open("examples/Other/003_Patient_NBS.fhir", "r") as f: return f.read() def get_orders_request_body(): # read the sample request body for the orders endpoint - with open("examples/fhir/lab_order.json", "r") as f: + with open("examples/Other/002_Order.fhir", "r") as f: return f.read()