From 12412a7be9f0e70045debb93f056296cd09290c3 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 9 Mar 2020 13:58:59 -0700 Subject: [PATCH] Add query capturing to query --- .../fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java index 274be7be184..c931660cdca 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java @@ -5,6 +5,7 @@ import ca.uhn.fhir.jpa.model.entity.*; import ca.uhn.fhir.jpa.searchparam.SearchParamConstants; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap.EverythingModeEnum; +import ca.uhn.fhir.jpa.util.SqlQuery; import ca.uhn.fhir.jpa.util.TestUtil; import ca.uhn.fhir.model.api.Include; import ca.uhn.fhir.model.api.TemporalPrecisionEnum; @@ -377,7 +378,9 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { SearchParameterMap chainQuery = new SearchParameterMap(); chainQuery.setLoadSynchronous(true); chainQuery.add(Observation.SP_DEVICE, new ReferenceParam("device", "urn:system|FOO").setChain("identifier")); + myCaptureQueriesListener.clear(); IBundleProvider chainSearch = myObservationDao.search(chainQuery); + List selectueriesForCurrentThread = myCaptureQueriesListener.getSelectQueriesForCurrentThread(); assertThat(chainQuery.size(), is(equalTo(1))); }