Test fixes

This commit is contained in:
James 2017-10-22 21:56:44 -04:00
parent 33f9437472
commit 59975948b2
27 changed files with 801 additions and 786 deletions

View File

@ -184,6 +184,8 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc {
StopWatch w = new StopWatch(); StopWatch w = new StopWatch();
final String searchUuid = UUID.randomUUID().toString(); final String searchUuid = UUID.randomUUID().toString();
ourLog.info("Registering new search {}", searchUuid);
Class<? extends IBaseResource> resourceTypeClass = myContext.getResourceDefinition(theResourceType).getImplementingClass(); Class<? extends IBaseResource> resourceTypeClass = myContext.getResourceDefinition(theResourceType).getImplementingClass();
final ISearchBuilder sb = theCallingDao.newSearchBuilder(); final ISearchBuilder sb = theCallingDao.newSearchBuilder();
sb.setType(resourceTypeClass, theResourceType); sb.setType(resourceTypeClass, theResourceType);
@ -204,6 +206,8 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc {
if (theParams.isLoadSynchronous() || loadSynchronousUpTo != null) { if (theParams.isLoadSynchronous() || loadSynchronousUpTo != null) {
ourLog.info("Search {} is loading in synchronous mode", searchUuid);
// Execute the query and make sure we return distinct results // Execute the query and make sure we return distinct results
TransactionTemplate txTemplate = new TransactionTemplate(myManagedTxManager); TransactionTemplate txTemplate = new TransactionTemplate(myManagedTxManager);
txTemplate.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRED); txTemplate.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRED);

View File

@ -69,16 +69,16 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
Patient patient = new Patient(); Patient patient = new Patient();
patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100");
patient.addName().setFamily("Tester").addGiven("Raghad"); patient.addName().setFamily("Tester").addGiven("Raghad");
IIdType id = ourClient.create().resource(patient).execute().getId(); IIdType id = myClient.create().resource(patient).execute().getId();
try { try {
ourClient.delete().resourceById(id.toUnqualifiedVersionless()).execute(); myClient.delete().resourceById(id.toUnqualifiedVersionless()).execute();
fail(); fail();
} catch (ForbiddenOperationException e) { } catch (ForbiddenOperationException e) {
// good // good
} }
patient = ourClient.read().resource(Patient.class).withId(id.toUnqualifiedVersionless()).execute(); patient = myClient.read().resource(Patient.class).withId(id.toUnqualifiedVersionless()).execute();
assertEquals(id.getValue(), patient.getId()); assertEquals(id.getValue(), patient.getId());
} }
@ -92,16 +92,16 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
Patient patient = new Patient(); Patient patient = new Patient();
patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100");
patient.addName().setFamily("Tester").addGiven("Raghad"); patient.addName().setFamily("Tester").addGiven("Raghad");
final IIdType id = ourClient.create().resource(patient).execute().getId(); final IIdType id = myClient.create().resource(patient).execute().getId();
Observation obsInCompartment = new Observation(); Observation obsInCompartment = new Observation();
obsInCompartment.setStatus(ObservationStatus.FINAL); obsInCompartment.setStatus(ObservationStatus.FINAL);
obsInCompartment.getSubject().setReferenceElement(id.toUnqualifiedVersionless()); obsInCompartment.getSubject().setReferenceElement(id.toUnqualifiedVersionless());
IIdType obsInCompartmentId = ourClient.create().resource(obsInCompartment).execute().getId().toUnqualifiedVersionless(); IIdType obsInCompartmentId = myClient.create().resource(obsInCompartment).execute().getId().toUnqualifiedVersionless();
Observation obsNotInCompartment = new Observation(); Observation obsNotInCompartment = new Observation();
obsNotInCompartment.setStatus(ObservationStatus.FINAL); obsNotInCompartment.setStatus(ObservationStatus.FINAL);
IIdType obsNotInCompartmentId = ourClient.create().resource(obsNotInCompartment).execute().getId().toUnqualifiedVersionless(); IIdType obsNotInCompartmentId = myClient.create().resource(obsNotInCompartment).execute().getId().toUnqualifiedVersionless();
ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) { ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) {
@Override @Override
@ -114,10 +114,10 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
} }
}); });
ourClient.delete().resourceById(obsInCompartmentId.toUnqualifiedVersionless()).execute(); myClient.delete().resourceById(obsInCompartmentId.toUnqualifiedVersionless()).execute();
try { try {
ourClient.delete().resourceById(obsNotInCompartmentId.toUnqualifiedVersionless()).execute(); myClient.delete().resourceById(obsNotInCompartmentId.toUnqualifiedVersionless()).execute();
fail(); fail();
} catch (ForbiddenOperationException e) { } catch (ForbiddenOperationException e) {
// good // good
@ -130,7 +130,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
Patient patient = new Patient(); Patient patient = new Patient();
patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100");
patient.addName().setFamily("Tester").addGiven("Raghad"); patient.addName().setFamily("Tester").addGiven("Raghad");
final MethodOutcome output1 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); final MethodOutcome output1 = myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute();
ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) { ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) {
@Override @Override
@ -148,7 +148,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
patient.setId(output1.getId().toUnqualifiedVersionless()); patient.setId(output1.getId().toUnqualifiedVersionless());
patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100");
patient.addName().setFamily("Tester").addGiven("Raghad"); patient.addName().setFamily("Tester").addGiven("Raghad");
MethodOutcome output2 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); MethodOutcome output2 = myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute();
assertEquals(output1.getId().getIdPart(), output2.getId().getIdPart()); assertEquals(output1.getId().getIdPart(), output2.getId().getIdPart());
@ -156,7 +156,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100");
patient.addName().setFamily("Tester").addGiven("Raghad"); patient.addName().setFamily("Tester").addGiven("Raghad");
try { try {
ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|101").execute(); myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|101").execute();
fail(); fail();
} catch (ForbiddenOperationException e) { } catch (ForbiddenOperationException e) {
assertEquals("HTTP 403 Forbidden: Access denied by default policy (no applicable rules)", e.getMessage()); assertEquals("HTTP 403 Forbidden: Access denied by default policy (no applicable rules)", e.getMessage());
@ -167,7 +167,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100");
patient.addName().setFamily("Tester").addGiven("Raghad"); patient.addName().setFamily("Tester").addGiven("Raghad");
try { try {
ourClient.update().resource(patient).execute(); myClient.update().resource(patient).execute();
fail(); fail();
} catch (ForbiddenOperationException e) { } catch (ForbiddenOperationException e) {
assertEquals("HTTP 403 Forbidden: Access denied by default policy (no applicable rules)", e.getMessage()); assertEquals("HTTP 403 Forbidden: Access denied by default policy (no applicable rules)", e.getMessage());
@ -182,11 +182,11 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
public void testBlockUpdatingPatientUserDoesnNotHaveAccessTo() throws IOException { public void testBlockUpdatingPatientUserDoesnNotHaveAccessTo() throws IOException {
Patient pt1 = new Patient(); Patient pt1 = new Patient();
pt1.setActive(true); pt1.setActive(true);
final IIdType pid1 = ourClient.create().resource(pt1).execute().getId().toUnqualifiedVersionless(); final IIdType pid1 = myClient.create().resource(pt1).execute().getId().toUnqualifiedVersionless();
Patient pt2 = new Patient(); Patient pt2 = new Patient();
pt2.setActive(false); pt2.setActive(false);
final IIdType pid2 = ourClient.create().resource(pt2).execute().getId().toUnqualifiedVersionless(); final IIdType pid2 = myClient.create().resource(pt2).execute().getId().toUnqualifiedVersionless();
ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) { ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) {
@Override @Override
@ -200,7 +200,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
Observation obs = new Observation(); Observation obs = new Observation();
obs.setStatus(ObservationStatus.FINAL); obs.setStatus(ObservationStatus.FINAL);
obs.setSubject(new Reference(pid1)); obs.setSubject(new Reference(pid1));
IIdType oid = ourClient.create().resource(obs).execute().getId().toUnqualified(); IIdType oid = myClient.create().resource(obs).execute().getId().toUnqualified();
unregisterInterceptors(); unregisterInterceptors();
@ -224,7 +224,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource
obs.setSubject(new Reference(pid2)); obs.setSubject(new Reference(pid2));
try { try {
ourClient.update().resource(obs).execute(); myClient.update().resource(obs).execute();
fail(); fail();
} catch (ForbiddenOperationException e) { } catch (ForbiddenOperationException e) {
// good // good

View File

@ -47,7 +47,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test { public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test {
protected static JpaValidationSupportChainR4 myValidationSupport; protected static JpaValidationSupportChainR4 myValidationSupport;
protected static IGenericClient ourClient; protected IGenericClient myClient;
protected static CloseableHttpClient ourHttpClient; protected static CloseableHttpClient ourHttpClient;
protected static int ourPort; protected static int ourPort;
protected static RestfulServer ourRestServer; protected static RestfulServer ourRestServer;
@ -150,10 +150,6 @@ public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test {
ourSearchParamRegistry = wac.getBean(SearchParamRegistryR4.class); ourSearchParamRegistry = wac.getBean(SearchParamRegistryR4.class);
myFhirCtx.getRestfulClientFactory().setSocketTimeout(5000000); myFhirCtx.getRestfulClientFactory().setSocketTimeout(5000000);
ourClient = myFhirCtx.newRestfulGenericClient(ourServerBase);
if (shouldLogClient()) {
ourClient.registerInterceptor(new LoggingInterceptor());
}
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
HttpClientBuilder builder = HttpClientBuilder.create(); HttpClientBuilder builder = HttpClientBuilder.create();
@ -165,6 +161,11 @@ public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test {
} }
ourRestServer.setPagingProvider(ourPagingProvider); ourRestServer.setPagingProvider(ourPagingProvider);
myClient = myFhirCtx.newRestfulGenericClient(ourServerBase);
if (shouldLogClient()) {
myClient.registerInterceptor(new LoggingInterceptor());
}
} }
/** /**

View File

@ -5,7 +5,6 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Patient;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -85,13 +84,13 @@ public class GraphQLProviderR4Test extends BaseResourceProviderR4Test {
p.addName() p.addName()
.addGiven("GivenOnly1") .addGiven("GivenOnly1")
.addGiven("GivenOnly2"); .addGiven("GivenOnly2");
myPatientId0 = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); myPatientId0 = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless();
p = new Patient(); p = new Patient();
p.addName() p.addName()
.addGiven("GivenOnlyB1") .addGiven("GivenOnlyB1")
.addGiven("GivenOnlyB2"); .addGiven("GivenOnlyB2");
ourClient.create().resource(p).execute(); myClient.create().resource(p).execute();
} }

View File

@ -57,41 +57,41 @@ public class PatientEverythingR4Test extends BaseResourceProviderR4Test {
Organization org = new Organization(); Organization org = new Organization();
org.setName("an org"); org.setName("an org");
orgId = ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless().getValue(); orgId = myClient.create().resource(org).execute().getId().toUnqualifiedVersionless().getValue();
ourLog.info("OrgId: {}", orgId); ourLog.info("OrgId: {}", orgId);
Patient patient = new Patient(); Patient patient = new Patient();
patient.getManagingOrganization().setReference(orgId); patient.getManagingOrganization().setReference(orgId);
patId = ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless().getValue(); patId = myClient.create().resource(patient).execute().getId().toUnqualifiedVersionless().getValue();
Patient patient2 = new Patient(); Patient patient2 = new Patient();
patient2.getManagingOrganization().setReference(orgId); patient2.getManagingOrganization().setReference(orgId);
myWrongPatId = ourClient.create().resource(patient2).execute().getId().toUnqualifiedVersionless().getValue(); myWrongPatId = myClient.create().resource(patient2).execute().getId().toUnqualifiedVersionless().getValue();
Encounter enc1 = new Encounter(); Encounter enc1 = new Encounter();
enc1.setStatus(EncounterStatus.CANCELLED); enc1.setStatus(EncounterStatus.CANCELLED);
enc1.getSubject().setReference(patId); enc1.getSubject().setReference(patId);
enc1.getServiceProvider().setReference(orgId); enc1.getServiceProvider().setReference(orgId);
encId1 = ourClient.create().resource(enc1).execute().getId().toUnqualifiedVersionless().getValue(); encId1 = myClient.create().resource(enc1).execute().getId().toUnqualifiedVersionless().getValue();
Encounter enc2 = new Encounter(); Encounter enc2 = new Encounter();
enc2.setStatus(EncounterStatus.ARRIVED); enc2.setStatus(EncounterStatus.ARRIVED);
enc2.getSubject().setReference(patId); enc2.getSubject().setReference(patId);
enc2.getServiceProvider().setReference(orgId); enc2.getServiceProvider().setReference(orgId);
encId2 = ourClient.create().resource(enc2).execute().getId().toUnqualifiedVersionless().getValue(); encId2 = myClient.create().resource(enc2).execute().getId().toUnqualifiedVersionless().getValue();
Encounter wrongEnc1 = new Encounter(); Encounter wrongEnc1 = new Encounter();
wrongEnc1.setStatus(EncounterStatus.ARRIVED); wrongEnc1.setStatus(EncounterStatus.ARRIVED);
wrongEnc1.getSubject().setReference(myWrongPatId); wrongEnc1.getSubject().setReference(myWrongPatId);
wrongEnc1.getServiceProvider().setReference(orgId); wrongEnc1.getServiceProvider().setReference(orgId);
myWrongEnc1 = ourClient.create().resource(wrongEnc1).execute().getId().toUnqualifiedVersionless().getValue(); myWrongEnc1 = myClient.create().resource(wrongEnc1).execute().getId().toUnqualifiedVersionless().getValue();
myObsIds = new ArrayList<String>(); myObsIds = new ArrayList<String>();
for (int i = 0; i < 20; i++) { for (int i = 0; i < 20; i++) {
Observation obs = new Observation(); Observation obs = new Observation();
obs.getSubject().setReference(patId); obs.getSubject().setReference(patId);
obs.setStatus(ObservationStatus.FINAL); obs.setStatus(ObservationStatus.FINAL);
String obsId = ourClient.create().resource(obs).execute().getId().toUnqualifiedVersionless().getValue(); String obsId = myClient.create().resource(obs).execute().getId().toUnqualifiedVersionless().getValue();
myObsIds.add(obsId); myObsIds.add(obsId);
} }

View File

@ -54,7 +54,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
sp.setTitle("Foo Param"); sp.setTitle("Foo Param");
try { try {
ourClient.create().resource(sp).execute(); myClient.create().resource(sp).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertEquals("HTTP 422 Unprocessable Entity: SearchParameter.status is missing or invalid: null", e.getMessage()); assertEquals("HTTP 422 Unprocessable Entity: SearchParameter.status is missing or invalid: null", e.getMessage());
@ -120,7 +120,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(eyeColourSp)); ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(eyeColourSp));
ourClient myClient
.create() .create()
.resource(eyeColourSp) .resource(eyeColourSp)
.execute(); .execute();
@ -139,7 +139,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
p2.addExtension().setUrl("http://acme.org/eyecolour").setValue(new CodeType("green")); p2.addExtension().setUrl("http://acme.org/eyecolour").setValue(new CodeType("green"));
IIdType p2id = myPatientDao.create(p2).getId().toUnqualifiedVersionless(); IIdType p2id = myPatientDao.create(p2).getId().toUnqualifiedVersionless();
Bundle bundle = ourClient Bundle bundle = myClient
.search() .search()
.forResource(Patient.class) .forResource(Patient.class)
.where(new TokenClientParam("eyecolour").exactly().code("blue")) .where(new TokenClientParam("eyecolour").exactly().code("blue"))
@ -168,7 +168,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
public void testConformanceOverrideAllowed() { public void testConformanceOverrideAllowed() {
myDaoConfig.setDefaultSearchParamsCanBeOverridden(true); myDaoConfig.setDefaultSearchParamsCanBeOverridden(true);
CapabilityStatement conformance = ourClient CapabilityStatement conformance = myClient
.fetchConformance() .fetchConformance()
.ofType(CapabilityStatement.class) .ofType(CapabilityStatement.class)
.execute(); .execute();
@ -220,7 +220,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
} }
}); });
conformance = ourClient conformance = myClient
.fetchConformance() .fetchConformance()
.ofType(CapabilityStatement.class) .ofType(CapabilityStatement.class)
.execute(); .execute();
@ -238,7 +238,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
public void testConformanceOverrideNotAllowed() { public void testConformanceOverrideNotAllowed() {
myDaoConfig.setDefaultSearchParamsCanBeOverridden(false); myDaoConfig.setDefaultSearchParamsCanBeOverridden(false);
CapabilityStatement conformance = ourClient CapabilityStatement conformance = myClient
.fetchConformance() .fetchConformance()
.ofType(CapabilityStatement.class) .ofType(CapabilityStatement.class)
.execute(); .execute();
@ -274,7 +274,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
mySearchParamRegsitry.forceRefresh(); mySearchParamRegsitry.forceRefresh();
conformance = ourClient conformance = myClient
.fetchConformance() .fetchConformance()
.ofType(CapabilityStatement.class) .ofType(CapabilityStatement.class)
.execute(); .execute();
@ -332,7 +332,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
List<String> foundResources; List<String> foundResources;
Bundle result; Bundle result;
result = ourClient result = myClient
.search() .search()
.forResource(Patient.class) .forResource(Patient.class)
.where(new TokenClientParam("foo").exactly().code("male")) .where(new TokenClientParam("foo").exactly().code("male"))
@ -409,7 +409,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
List<String> foundResources; List<String> foundResources;
Bundle result; Bundle result;
result = ourClient result = myClient
.search() .search()
.forResource(Observation.class) .forResource(Observation.class)
.where(new ReferenceClientParam("foo").hasChainedProperty(Patient.GENDER.exactly().code("male"))) .where(new ReferenceClientParam("foo").hasChainedProperty(Patient.GENDER.exactly().code("male")))

View File

@ -198,7 +198,7 @@ public class ResourceProviderInterceptorR4Test extends BaseResourceProviderR4Tes
Organization org = new Organization(); Organization org = new Organization();
org.setName("orgName"); org.setName("orgName");
IIdType orgId = ourClient.create().resource(org).execute().getId().toUnqualified(); IIdType orgId = myClient.create().resource(org).execute().getId().toUnqualified();
assertNotNull(orgId.getVersionIdPartAsLong()); assertNotNull(orgId.getVersionIdPartAsLong());
resetServerInterceptor(); resetServerInterceptor();

View File

@ -72,7 +72,7 @@ public class ResourceProviderQuestionnaireResponseR4Test extends BaseResourcePro
qr1.setStatus(QuestionnaireResponseStatus.COMPLETED); qr1.setStatus(QuestionnaireResponseStatus.COMPLETED);
qr1.addItem().setLinkId("link1").addAnswer().setValue(new DecimalType(123)); qr1.addItem().setLinkId("link1").addAnswer().setValue(new DecimalType(123));
try { try {
ourClient.create().resource(qr1).execute(); myClient.create().resource(qr1).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertThat(e.toString(), containsString("Answer value must be of type string")); assertThat(e.toString(), containsString("Answer value must be of type string"));
@ -95,7 +95,7 @@ public class ResourceProviderQuestionnaireResponseR4Test extends BaseResourcePro
qr1.setStatus(QuestionnaireResponseStatus.COMPLETED); qr1.setStatus(QuestionnaireResponseStatus.COMPLETED);
qr1.addItem().setLinkId("link1").addAnswer().setValue(new DecimalType(123)); qr1.addItem().setLinkId("link1").addAnswer().setValue(new DecimalType(123));
try { try {
ourClient.create().resource(qr1).execute(); myClient.create().resource(qr1).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertThat(e.toString(), containsString("Answer value must be of type string")); assertThat(e.toString(), containsString("Answer value must be of type string"));

View File

@ -34,9 +34,9 @@ public class ResourceProviderR4BundleTest extends BaseResourceProviderR4Test {
composition.setTitle("Visit Summary"); composition.setTitle("Visit Summary");
bundle.addEntry().setFullUrl("http://foo").setResource(composition); bundle.addEntry().setFullUrl("http://foo").setResource(composition);
IIdType id = ourClient.create().resource(bundle).execute().getId(); IIdType id = myClient.create().resource(bundle).execute().getId();
Bundle retBundle = ourClient.read().resource(Bundle.class).withId(id).execute(); Bundle retBundle = myClient.read().resource(Bundle.class).withId(id).execute();
ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle)); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle));
assertEquals("http://foo", bundle.getEntry().get(0).getFullUrl()); assertEquals("http://foo", bundle.getEntry().get(0).getFullUrl());

View File

@ -35,7 +35,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
myDaoConfig.setReuseCachedSearchResultsForMillis(new DaoConfig().getReuseCachedSearchResultsForMillis()); myDaoConfig.setReuseCachedSearchResultsForMillis(new DaoConfig().getReuseCachedSearchResultsForMillis());
myDaoConfig.setCacheControlNoStoreMaxResultsUpperLimit(new DaoConfig().getCacheControlNoStoreMaxResultsUpperLimit()); myDaoConfig.setCacheControlNoStoreMaxResultsUpperLimit(new DaoConfig().getCacheControlNoStoreMaxResultsUpperLimit());
ourClient.unregisterInterceptor(myCapturingInterceptor); myClient.unregisterInterceptor(myCapturingInterceptor);
} }
@Override @Override
@ -45,7 +45,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
mySearchCoordinatorSvcRaw = AopTestUtils.getTargetObject(mySearchCoordinatorSvc); mySearchCoordinatorSvcRaw = AopTestUtils.getTargetObject(mySearchCoordinatorSvc);
myCapturingInterceptor = new CapturingInterceptor(); myCapturingInterceptor = new CapturingInterceptor();
ourClient.registerInterceptor(myCapturingInterceptor); myClient.registerInterceptor(myCapturingInterceptor);
} }
@Test @Test
@ -53,9 +53,9 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
Patient pt1 = new Patient(); Patient pt1 = new Patient();
pt1.addName().setFamily("FAM"); pt1.addName().setFamily("FAM");
ourClient.create().resource(pt1).execute(); myClient.create().resource(pt1).execute();
Bundle results = ourClient Bundle results = myClient
.search() .search()
.forResource("Patient") .forResource("Patient")
.where(Patient.FAMILY.matches().value("FAM")) .where(Patient.FAMILY.matches().value("FAM"))
@ -68,9 +68,9 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
Patient pt2 = new Patient(); Patient pt2 = new Patient();
pt2.addName().setFamily("FAM"); pt2.addName().setFamily("FAM");
ourClient.create().resource(pt2).execute(); myClient.create().resource(pt2).execute();
results = ourClient results = myClient
.search() .search()
.forResource("Patient") .forResource("Patient")
.where(Patient.FAMILY.matches().value("FAM")) .where(Patient.FAMILY.matches().value("FAM"))
@ -89,10 +89,10 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
Patient pt1 = new Patient(); Patient pt1 = new Patient();
pt1.addName().setFamily("FAM" + i); pt1.addName().setFamily("FAM" + i);
ourClient.create().resource(pt1).execute(); myClient.create().resource(pt1).execute();
} }
Bundle results = ourClient Bundle results = myClient
.search() .search()
.forResource("Patient") .forResource("Patient")
.where(Patient.FAMILY.matches().value("FAM")) .where(Patient.FAMILY.matches().value("FAM"))
@ -109,7 +109,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
public void testCacheNoStoreMaxResultsWithIllegalValue() throws IOException { public void testCacheNoStoreMaxResultsWithIllegalValue() throws IOException {
myDaoConfig.setCacheControlNoStoreMaxResultsUpperLimit(123); myDaoConfig.setCacheControlNoStoreMaxResultsUpperLimit(123);
try { try {
ourClient myClient
.search() .search()
.forResource("Patient") .forResource("Patient")
.where(Patient.FAMILY.matches().value("FAM")) .where(Patient.FAMILY.matches().value("FAM"))
@ -127,18 +127,18 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
Patient pt1 = new Patient(); Patient pt1 = new Patient();
pt1.addName().setFamily("FAM"); pt1.addName().setFamily("FAM");
ourClient.create().resource(pt1).execute(); myClient.create().resource(pt1).execute();
Bundle results = ourClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); Bundle results = myClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute();
assertEquals(1, results.getEntry().size()); assertEquals(1, results.getEntry().size());
assertEquals(1, mySearchEntityDao.count()); assertEquals(1, mySearchEntityDao.count());
assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), empty()); assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), empty());
Patient pt2 = new Patient(); Patient pt2 = new Patient();
pt2.addName().setFamily("FAM"); pt2.addName().setFamily("FAM");
ourClient.create().resource(pt2).execute(); myClient.create().resource(pt2).execute();
results = ourClient results = myClient
.search() .search()
.forResource("Patient") .forResource("Patient")
.where(Patient.FAMILY.matches().value("FAM")) .where(Patient.FAMILY.matches().value("FAM"))
@ -156,11 +156,11 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
Patient pt1 = new Patient(); Patient pt1 = new Patient();
pt1.addName().setFamily("FAM"); pt1.addName().setFamily("FAM");
ourClient.create().resource(pt1).execute(); myClient.create().resource(pt1).execute();
Date beforeFirst = new Date(); Date beforeFirst = new Date();
Bundle results1 = ourClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); Bundle results1 = myClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute();
assertEquals(1, results1.getEntry().size()); assertEquals(1, results1.getEntry().size());
assertEquals(1, mySearchEntityDao.count()); assertEquals(1, mySearchEntityDao.count());
assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), empty()); assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), empty());
@ -170,9 +170,9 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
Patient pt2 = new Patient(); Patient pt2 = new Patient();
pt2.addName().setFamily("FAM"); pt2.addName().setFamily("FAM");
ourClient.create().resource(pt2).execute(); myClient.create().resource(pt2).execute();
Bundle results2 = ourClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); Bundle results2 = myClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute();
assertEquals(1, results2.getEntry().size()); assertEquals(1, results2.getEntry().size());
assertEquals(1, mySearchEntityDao.count()); assertEquals(1, mySearchEntityDao.count());
assertEquals("HIT from " + ourServerBase, myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE).get(0)); assertEquals("HIT from " + ourServerBase, myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE).get(0));

View File

@ -40,7 +40,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
public void testLookupOnExternalCode() { public void testLookupOnExternalCode() {
ResourceProviderR4ValueSetTest.createExternalCs(myCodeSystemDao, myResourceTableDao, myTermSvc, mySrd); ResourceProviderR4ValueSetTest.createExternalCs(myCodeSystemDao, myResourceTableDao, myTermSvc, mySrd);
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -59,7 +59,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
assertEquals(false, ((BooleanType)respParam.getParameter().get(2).getValue()).getValue().booleanValue()); assertEquals(false, ((BooleanType)respParam.getParameter().get(2).getValue()).getValue().booleanValue());
// With HTTP GET // With HTTP GET
respParam = ourClient respParam = myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -82,7 +82,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
@Test @Test
public void testLookupOperationByCodeAndSystemBuiltInCode() { public void testLookupOperationByCodeAndSystemBuiltInCode() {
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -105,7 +105,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
public void testLookupOperationByCodeAndSystemBuiltInNonexistantCode() { public void testLookupOperationByCodeAndSystemBuiltInNonexistantCode() {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -122,7 +122,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
@Test @Test
public void testLookupOperationByCodeAndSystemUserDefinedCode() { public void testLookupOperationByCodeAndSystemUserDefinedCode() {
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -146,7 +146,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
public void testLookupOperationByCodeAndSystemUserDefinedNonExistantCode() { public void testLookupOperationByCodeAndSystemUserDefinedNonExistantCode() {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -163,7 +163,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
@Test @Test
public void testLookupOperationByCoding() { public void testLookupOperationByCoding() {
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -186,7 +186,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
public void testLookupOperationByInvalidCombination() { public void testLookupOperationByInvalidCombination() {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -205,7 +205,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
public void testLookupOperationByInvalidCombination2() { public void testLookupOperationByInvalidCombination2() {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -223,7 +223,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
public void testLookupOperationByInvalidCombination3() { public void testLookupOperationByInvalidCombination3() {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")
@ -240,7 +240,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
// @Ignore // @Ignore
public void testLookupOperationForBuiltInCode() { public void testLookupOperationForBuiltInCode() {
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(CodeSystem.class) .onType(CodeSystem.class)
.named("lookup") .named("lookup")

View File

@ -121,7 +121,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
@Test @Test
public void testExpandById() throws IOException { public void testExpandById() throws IOException {
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onInstance(myExtensionalVsId) .onInstance(myExtensionalVsId)
.named("expand") .named("expand")
@ -152,7 +152,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
public void testExpandByIdWithFilter() throws IOException { public void testExpandByIdWithFilter() throws IOException {
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onInstance(myExtensionalVsId) .onInstance(myExtensionalVsId)
.named("expand") .named("expand")
@ -170,7 +170,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
@Test @Test
public void testExpandByUrl() { public void testExpandByUrl() {
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("expand") .named("expand")
@ -190,7 +190,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
public void testExpandByValueSet() throws IOException { public void testExpandByValueSet() throws IOException {
ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml"); ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml");
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("expand") .named("expand")
@ -213,7 +213,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
assertNotNull(myLocalValueSetId); assertNotNull(myLocalValueSetId);
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("expand") .named("expand")
@ -235,7 +235,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
myLocalVs.setId(""); myLocalVs.setId("");
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("expand") .named("expand")
@ -257,7 +257,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
public void testExpandInvalidParams() throws IOException { public void testExpandInvalidParams() throws IOException {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("expand") .named("expand")
@ -272,7 +272,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
//@formatter:off //@formatter:off
try { try {
ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/r4/extensional-case-r4.xml"); ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/r4/extensional-case-r4.xml");
ourClient myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("expand") .named("expand")
@ -288,7 +288,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
//@formatter:off //@formatter:off
try { try {
ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/r4/extensional-case.xml"); ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/r4/extensional-case.xml");
ourClient myClient
.operation() .operation()
.onInstance(myExtensionalVsId) .onInstance(myExtensionalVsId)
.named("expand") .named("expand")
@ -309,7 +309,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
assertNotNull(myLocalValueSetId); assertNotNull(myLocalValueSetId);
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onInstance(myLocalValueSetId) .onInstance(myLocalValueSetId)
.named("expand") .named("expand")
@ -330,7 +330,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
assertNotNull(myLocalValueSetId); assertNotNull(myLocalValueSetId);
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onInstance(myLocalValueSetId) .onInstance(myLocalValueSetId)
.named("expand") .named("expand")
@ -354,7 +354,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
assertNotNull(myLocalValueSetId); assertNotNull(myLocalValueSetId);
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("expand") .named("expand")
@ -379,7 +379,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onInstance(myLocalValueSetId) .onInstance(myLocalValueSetId)
.named("expand") .named("expand")
@ -419,7 +419,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
@Test @Test
public void testValidateCodeOperationByCodeAndSystemInstance() { public void testValidateCodeOperationByCodeAndSystemInstance() {
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onInstance(myExtensionalVsId) .onInstance(myExtensionalVsId)
.named("validate-code") .named("validate-code")
@ -437,7 +437,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
@Test @Test
public void testValidateCodeOperationByCodeAndSystemType() { public void testValidateCodeOperationByCodeAndSystemType() {
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("validate-code") .named("validate-code")
@ -454,7 +454,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
@Test @Test
public void testValiedateCodeAgainstBuiltInSystem() { public void testValiedateCodeAgainstBuiltInSystem() {
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onType(ValueSet.class) .onType(ValueSet.class)
.named("validate-code") .named("validate-code")

View File

@ -56,7 +56,7 @@ public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test {
} }
//@formatter:off //@formatter:off
IClientExecutable<IQuery<Bundle>, Bundle> search = ourClient IClientExecutable<IQuery<Bundle>, Bundle> search = myClient
.search() .search()
.forResource(Patient.class) .forResource(Patient.class)
.where(Patient.NAME.matches().value("Everything")) .where(Patient.NAME.matches().value("Everything"))
@ -74,12 +74,12 @@ public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test {
String nextLinkUrl = nextLink.getUrl(); String nextLinkUrl = nextLink.getUrl();
assertThat(nextLinkUrl, not(blankOrNullString())); assertThat(nextLinkUrl, not(blankOrNullString()));
Bundle resp2 = ourClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); Bundle resp2 = myClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute();
ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(resp2)); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(resp2));
myStaleSearchDeletingSvc.pollForStaleSearchesAndDeleteThem(); myStaleSearchDeletingSvc.pollForStaleSearchesAndDeleteThem();
ourClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); myClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute();
Thread.sleep(20); Thread.sleep(20);
myDaoConfig.setExpireSearchResultsAfterMillis(10); myDaoConfig.setExpireSearchResultsAfterMillis(10);
@ -87,7 +87,7 @@ public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test {
myStaleSearchDeletingSvc.pollForStaleSearchesAndDeleteThem(); myStaleSearchDeletingSvc.pollForStaleSearchesAndDeleteThem();
try { try {
ourClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); myClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute();
fail(); fail();
} catch (ResourceGoneException e) { } catch (ResourceGoneException e) {
assertThat(e.getMessage(), containsString("does not exist and may have expired")); assertThat(e.getMessage(), containsString("does not exist and may have expired"));

View File

@ -57,7 +57,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
subs.getChannel().setEndpoint("http://localhost:8888"); subs.getChannel().setEndpoint("http://localhost:8888");
subs.setCriteria("Observation?identifier=123"); subs.setCriteria("Observation?identifier=123");
try { try {
ourClient.create().resource(subs).execute(); myClient.create().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server"));
@ -65,14 +65,14 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
subs.setId("ABC"); subs.setId("ABC");
try { try {
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server"));
} }
subs.setStatus(SubscriptionStatus.REQUESTED); subs.setStatus(SubscriptionStatus.REQUESTED);
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
} }
@Test @Test
@ -84,7 +84,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
subs.setStatus(SubscriptionStatus.ACTIVE); subs.setStatus(SubscriptionStatus.ACTIVE);
subs.setCriteria("Observation?identifier=123"); subs.setCriteria("Observation?identifier=123");
try { try {
ourClient.create().resource(subs).execute(); myClient.create().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertEquals("HTTP 422 Unprocessable Entity: Subscription.status must be 'off' or 'requested' on a newly created subscription", e.getMessage()); assertEquals("HTTP 422 Unprocessable Entity: Subscription.status must be 'off' or 'requested' on a newly created subscription", e.getMessage());
@ -92,7 +92,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
subs.setId("ABC"); subs.setId("ABC");
try { try {
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertEquals("HTTP 422 Unprocessable Entity: Subscription.status must be 'off' or 'requested' on a newly created subscription", e.getMessage()); assertEquals("HTTP 422 Unprocessable Entity: Subscription.status must be 'off' or 'requested' on a newly created subscription", e.getMessage());
@ -109,13 +109,13 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
subs.getChannel().setEndpoint("http://localhost:8888"); subs.getChannel().setEndpoint("http://localhost:8888");
subs.setStatus(SubscriptionStatus.REQUESTED); subs.setStatus(SubscriptionStatus.REQUESTED);
subs.setCriteria("Observation?identifier=123"); subs.setCriteria("Observation?identifier=123");
IIdType id = ourClient.create().resource(subs).execute().getId().toUnqualifiedVersionless(); IIdType id = myClient.create().resource(subs).execute().getId().toUnqualifiedVersionless();
subs.setId(id); subs.setId(id);
try { try {
subs.setStatus(SubscriptionStatus.ACTIVE); subs.setStatus(SubscriptionStatus.ACTIVE);
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertEquals("HTTP 422 Unprocessable Entity: Subscription.status can not be changed from 'requested' to 'active'", e.getMessage()); assertEquals("HTTP 422 Unprocessable Entity: Subscription.status can not be changed from 'requested' to 'active'", e.getMessage());
@ -123,7 +123,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
try { try {
subs.setStatus((SubscriptionStatus) null); subs.setStatus((SubscriptionStatus) null);
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server"));
@ -141,12 +141,12 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
subs.getChannel().setEndpoint("http://localhost:8888"); subs.getChannel().setEndpoint("http://localhost:8888");
subs.setCriteria("Observation?identifier=123"); subs.setCriteria("Observation?identifier=123");
subs.setStatus(SubscriptionStatus.REQUESTED); subs.setStatus(SubscriptionStatus.REQUESTED);
IIdType id = ourClient.create().resource(subs).execute().getId(); IIdType id = myClient.create().resource(subs).execute().getId();
subs.setId(id); subs.setId(id);
try { try {
subs.setStatus(SubscriptionStatus.ACTIVE); subs.setStatus(SubscriptionStatus.ACTIVE);
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertEquals("HTTP 422 Unprocessable Entity: Subscription.status can not be changed from 'requested' to 'active'", e.getMessage()); assertEquals("HTTP 422 Unprocessable Entity: Subscription.status can not be changed from 'requested' to 'active'", e.getMessage());
@ -154,14 +154,14 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test {
try { try {
subs.setStatus((SubscriptionStatus) null); subs.setStatus((SubscriptionStatus) null);
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
fail(); fail();
} catch (UnprocessableEntityException e) { } catch (UnprocessableEntityException e) {
assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server"));
} }
subs.setStatus(SubscriptionStatus.OFF); subs.setStatus(SubscriptionStatus.OFF);
ourClient.update().resource(subs).execute(); myClient.update().resource(subs).execute();
} }
@AfterClass @AfterClass

View File

@ -43,7 +43,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
byte[] packageBytes = createSctZip(); byte[] packageBytes = createSctZip();
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onServer() .onServer()
.named("upload-external-code-system") .named("upload-external-code-system")
@ -63,7 +63,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
byte[] packageBytes = createLoincZip(); byte[] packageBytes = createLoincZip();
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onServer() .onServer()
.named("upload-external-code-system") .named("upload-external-code-system")
@ -82,7 +82,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
*/ */
//@formatter:off //@formatter:off
respParam = ourClient respParam = myClient
.operation() .operation()
.onServer() .onServer()
.named("upload-external-code-system") .named("upload-external-code-system")
@ -107,7 +107,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
fos.close(); fos.close();
//@formatter:off //@formatter:off
Parameters respParam = ourClient Parameters respParam = myClient
.operation() .operation()
.onServer() .onServer()
.named("upload-external-code-system") .named("upload-external-code-system")
@ -128,7 +128,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onServer() .onServer()
.named("upload-external-code-system") .named("upload-external-code-system")
@ -148,7 +148,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onServer() .onServer()
.named("upload-external-code-system") .named("upload-external-code-system")
@ -165,7 +165,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
public void testUploadMissingPackage() throws Exception { public void testUploadMissingPackage() throws Exception {
//@formatter:off //@formatter:off
try { try {
ourClient myClient
.operation() .operation()
.onServer() .onServer()
.named("upload-external-code-system") .named("upload-external-code-system")

View File

@ -61,7 +61,7 @@ public class PagingMultinodeProviderR4Test extends BaseResourceProviderR4Test {
mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(10); mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(10);
mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(true); mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(true);
found = ourClient found = myClient
.search() .search()
.forResource(Patient.class) .forResource(Patient.class)
.sort().ascending(Patient.SP_FAMILY) .sort().ascending(Patient.SP_FAMILY)
@ -70,19 +70,19 @@ public class PagingMultinodeProviderR4Test extends BaseResourceProviderR4Test {
.execute(); .execute();
assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A000", "Patient/A001", "Patient/A002", "Patient/A003", "Patient/A004", "Patient/A005", "Patient/A006", "Patient/A007", "Patient/A008", "Patient/A009")); assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A000", "Patient/A001", "Patient/A002", "Patient/A003", "Patient/A004", "Patient/A005", "Patient/A006", "Patient/A007", "Patient/A008", "Patient/A009"));
found = ourClient found = myClient
.loadPage() .loadPage()
.next(found) .next(found)
.execute(); .execute();
assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A010", "Patient/A011", "Patient/A012", "Patient/A013", "Patient/A014", "Patient/A015", "Patient/A016", "Patient/A017", "Patient/A018", "Patient/A019")); assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A010", "Patient/A011", "Patient/A012", "Patient/A013", "Patient/A014", "Patient/A015", "Patient/A016", "Patient/A017", "Patient/A018", "Patient/A019"));
found = ourClient found = myClient
.loadPage() .loadPage()
.next(found) .next(found)
.execute(); .execute();
assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A020", "Patient/A021", "Patient/A022", "Patient/A023", "Patient/A024", "Patient/A025", "Patient/A026", "Patient/A027", "Patient/A028", "Patient/A029")); assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A020", "Patient/A021", "Patient/A022", "Patient/A023", "Patient/A024", "Patient/A025", "Patient/A026", "Patient/A027", "Patient/A028", "Patient/A029"));
found = ourClient found = myClient
.loadPage() .loadPage()
.next(found) .next(found)
.execute(); .execute();

View File

@ -54,7 +54,7 @@ public class RestHookActivatesPreExistingSubscriptionsR4Test extends BaseResourc
channel.setPayload(thePayload); channel.setPayload(thePayload);
channel.setEndpoint(theEndpoint); channel.setEndpoint(theEndpoint);
MethodOutcome methodOutcome = ourClient.create().resource(subscription).execute(); MethodOutcome methodOutcome = myClient.create().resource(subscription).execute();
subscription.setId(methodOutcome.getId().getIdPart()); subscription.setId(methodOutcome.getId().getIdPart());
waitForQueueToDrain(); waitForQueueToDrain();
@ -71,7 +71,7 @@ public class RestHookActivatesPreExistingSubscriptionsR4Test extends BaseResourc
observation.setStatus(Observation.ObservationStatus.FINAL); observation.setStatus(Observation.ObservationStatus.FINAL);
MethodOutcome methodOutcome = ourClient.create().resource(observation).execute(); MethodOutcome methodOutcome = myClient.create().resource(observation).execute();
String observationId = methodOutcome.getId().getIdPart(); String observationId = methodOutcome.getId().getIdPart();
observation.setId(observationId); observation.setId(observationId);

View File

@ -53,14 +53,14 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
for (IIdType next : mySubscriptionIds) { for (IIdType next : mySubscriptionIds) {
IIdType nextId = next.toUnqualifiedVersionless(); IIdType nextId = next.toUnqualifiedVersionless();
ourLog.info("Deleting: {}", nextId); ourLog.info("Deleting: {}", nextId);
ourClient.delete().resourceById(nextId).execute(); myClient.delete().resourceById(nextId).execute();
} }
mySubscriptionIds.clear(); mySubscriptionIds.clear();
myDaoConfig.setAllowMultipleDelete(true); myDaoConfig.setAllowMultipleDelete(true);
ourLog.info("Deleting all subscriptions"); ourLog.info("Deleting all subscriptions");
ourClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); myClient.delete().resourceConditionalByUrl("Subscription?status=active").execute();
ourClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute(); myClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute();
ourLog.info("Done deleting all subscriptions"); ourLog.info("Done deleting all subscriptions");
myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete()); myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete());
@ -91,7 +91,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
channel.setPayload(thePayload); channel.setPayload(thePayload);
channel.setEndpoint(theEndpoint); channel.setEndpoint(theEndpoint);
MethodOutcome methodOutcome = ourClient.create().resource(subscription).execute(); MethodOutcome methodOutcome = myClient.create().resource(subscription).execute();
subscription.setId(methodOutcome.getId().getIdPart()); subscription.setId(methodOutcome.getId().getIdPart());
mySubscriptionIds.add(methodOutcome.getId()); mySubscriptionIds.add(methodOutcome.getId());
@ -109,7 +109,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
observation.setStatus(Observation.ObservationStatus.FINAL); observation.setStatus(Observation.ObservationStatus.FINAL);
MethodOutcome methodOutcome = ourClient.create().resource(observation).execute(); MethodOutcome methodOutcome = myClient.create().resource(observation).execute();
String observationId = methodOutcome.getId().getIdPart(); String observationId = methodOutcome.getId().getIdPart();
observation.setId(observationId); observation.setId(observationId);
@ -156,11 +156,11 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
waitForSize(1, ourUpdatedObservations); waitForSize(1, ourUpdatedObservations);
assertEquals(Constants.CT_FHIR_JSON_NEW, ourContentTypes.get(0)); assertEquals(Constants.CT_FHIR_JSON_NEW, ourContentTypes.get(0));
Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId());
Assert.assertNotNull(subscriptionTemp); Assert.assertNotNull(subscriptionTemp);
subscriptionTemp.setCriteria(criteria1); subscriptionTemp.setCriteria(criteria1);
ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();
waitForQueueToDrain(); waitForQueueToDrain();
Observation observation2 = sendObservation(code, "SNOMED-CT"); Observation observation2 = sendObservation(code, "SNOMED-CT");
@ -170,7 +170,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(3, ourUpdatedObservations); waitForSize(3, ourUpdatedObservations);
ourClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute(); myClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute();
waitForQueueToDrain(); waitForQueueToDrain();
Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); Observation observationTemp3 = sendObservation(code, "SNOMED-CT");
@ -180,27 +180,27 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3 = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept = new CodeableConcept(); CodeableConcept codeableConcept = new CodeableConcept();
observation3.setCode(codeableConcept); observation3.setCode(codeableConcept);
Coding coding = codeableConcept.addCoding(); Coding coding = codeableConcept.addCoding();
coding.setCode(code + "111"); coding.setCode(code + "111");
coding.setSystem("SNOMED-CT"); coding.setSystem("SNOMED-CT");
ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); myClient.update().resource(observation3).withId(observation3.getIdElement()).execute();
// Should see no subscription notification // Should see no subscription notification
waitForQueueToDrain(); waitForQueueToDrain();
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3a = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept1 = new CodeableConcept(); CodeableConcept codeableConcept1 = new CodeableConcept();
observation3a.setCode(codeableConcept1); observation3a.setCode(codeableConcept1);
Coding coding1 = codeableConcept1.addCoding(); Coding coding1 = codeableConcept1.addCoding();
coding1.setCode(code); coding1.setCode(code);
coding1.setSystem("SNOMED-CT"); coding1.setSystem("SNOMED-CT");
ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();
// Should see only one subscription notification // Should see only one subscription notification
waitForQueueToDrain(); waitForQueueToDrain();
@ -231,10 +231,10 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
waitForSize(1, ourUpdatedObservations); waitForSize(1, ourUpdatedObservations);
assertEquals(Constants.CT_FHIR_XML_NEW, ourContentTypes.get(0)); assertEquals(Constants.CT_FHIR_XML_NEW, ourContentTypes.get(0));
Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId());
Assert.assertNotNull(subscriptionTemp); Assert.assertNotNull(subscriptionTemp);
subscriptionTemp.setCriteria(criteria1); subscriptionTemp.setCriteria(criteria1);
ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();
waitForQueueToDrain(); waitForQueueToDrain();
Observation observation2 = sendObservation(code, "SNOMED-CT"); Observation observation2 = sendObservation(code, "SNOMED-CT");
@ -244,7 +244,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(3, ourUpdatedObservations); waitForSize(3, ourUpdatedObservations);
ourClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute(); myClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute();
Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); Observation observationTemp3 = sendObservation(code, "SNOMED-CT");
@ -253,27 +253,27 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3 = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept = new CodeableConcept(); CodeableConcept codeableConcept = new CodeableConcept();
observation3.setCode(codeableConcept); observation3.setCode(codeableConcept);
Coding coding = codeableConcept.addCoding(); Coding coding = codeableConcept.addCoding();
coding.setCode(code + "111"); coding.setCode(code + "111");
coding.setSystem("SNOMED-CT"); coding.setSystem("SNOMED-CT");
ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); myClient.update().resource(observation3).withId(observation3.getIdElement()).execute();
// Should see no subscription notification // Should see no subscription notification
waitForQueueToDrain(); waitForQueueToDrain();
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3a = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept1 = new CodeableConcept(); CodeableConcept codeableConcept1 = new CodeableConcept();
observation3a.setCode(codeableConcept1); observation3a.setCode(codeableConcept1);
Coding coding1 = codeableConcept1.addCoding(); Coding coding1 = codeableConcept1.addCoding();
coding1.setCode(code); coding1.setCode(code);
coding1.setSystem("SNOMED-CT"); coding1.setSystem("SNOMED-CT");
ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();
// Should see only one subscription notification // Should see only one subscription notification
waitForQueueToDrain(); waitForQueueToDrain();
@ -333,7 +333,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
subscription.getChannel().addHeader("X-Foo: FOO"); subscription.getChannel().addHeader("X-Foo: FOO");
subscription.getChannel().addHeader("X-Bar: BAR"); subscription.getChannel().addHeader("X-Bar: BAR");
subscription.setStatus(Subscription.SubscriptionStatus.REQUESTED); subscription.setStatus(Subscription.SubscriptionStatus.REQUESTED);
ourClient.update().resource(subscription).execute(); myClient.update().resource(subscription).execute();
waitForQueueToDrain(); waitForQueueToDrain();
sendObservation(code, "SNOMED-CT"); sendObservation(code, "SNOMED-CT");
@ -364,7 +364,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test {
// Disable // Disable
subscription.setStatus(Subscription.SubscriptionStatus.OFF); subscription.setStatus(Subscription.SubscriptionStatus.OFF);
ourClient.update().resource(subscription).execute(); myClient.update().resource(subscription).execute();
waitForQueueToDrain(); waitForQueueToDrain();
// Send another object // Send another object

View File

@ -1,8 +1,6 @@
package ca.uhn.fhir.jpa.subscription.r4; package ca.uhn.fhir.jpa.subscription.r4;
import static org.junit.Assert.*;
import java.util.List; import java.util.List;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
@ -46,7 +44,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
public void afterUnregisterRestHookListener() { public void afterUnregisterRestHookListener() {
myDaoConfig.setAllowMultipleDelete(true); myDaoConfig.setAllowMultipleDelete(true);
ourLog.info("Deleting all subscriptions"); ourLog.info("Deleting all subscriptions");
ourClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); myClient.delete().resourceConditionalByUrl("Subscription?status=active").execute();
ourLog.info("Done deleting all subscriptions"); ourLog.info("Done deleting all subscriptions");
myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete()); myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete());
@ -76,7 +74,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
channel.setEndpoint(endpoint); channel.setEndpoint(endpoint);
subscription.setChannel(channel); subscription.setChannel(channel);
MethodOutcome methodOutcome = ourClient.create().resource(subscription).execute(); MethodOutcome methodOutcome = myClient.create().resource(subscription).execute();
subscription.setId(methodOutcome.getId().getIdPart()); subscription.setId(methodOutcome.getId().getIdPart());
waitForQueueToDrain(); waitForQueueToDrain();
@ -101,7 +99,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
observation.setStatus(Observation.ObservationStatus.FINAL); observation.setStatus(Observation.ObservationStatus.FINAL);
MethodOutcome methodOutcome = ourClient.create().resource(observation).execute(); MethodOutcome methodOutcome = myClient.create().resource(observation).execute();
String observationId = methodOutcome.getId().getIdPart(); String observationId = methodOutcome.getId().getIdPart();
observation.setId(observationId); observation.setId(observationId);
@ -129,11 +127,11 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(1, ourUpdatedObservations); waitForSize(1, ourUpdatedObservations);
Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId());
Assert.assertNotNull(subscriptionTemp); Assert.assertNotNull(subscriptionTemp);
subscriptionTemp.setCriteria(criteria1); subscriptionTemp.setCriteria(criteria1);
ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();
Observation observation2 = sendObservation(code, "SNOMED-CT"); Observation observation2 = sendObservation(code, "SNOMED-CT");
@ -143,7 +141,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(3, ourUpdatedObservations); waitForSize(3, ourUpdatedObservations);
ourClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute(); myClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute();
Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); Observation observationTemp3 = sendObservation(code, "SNOMED-CT");
@ -152,27 +150,27 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3 = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept = new CodeableConcept(); CodeableConcept codeableConcept = new CodeableConcept();
observation3.setCode(codeableConcept); observation3.setCode(codeableConcept);
Coding coding = codeableConcept.addCoding(); Coding coding = codeableConcept.addCoding();
coding.setCode(code + "111"); coding.setCode(code + "111");
coding.setSystem("SNOMED-CT"); coding.setSystem("SNOMED-CT");
ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); myClient.update().resource(observation3).withId(observation3.getIdElement()).execute();
// Should see no subscription notification // Should see no subscription notification
Thread.sleep(500); Thread.sleep(500);
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3a = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept1 = new CodeableConcept(); CodeableConcept codeableConcept1 = new CodeableConcept();
observation3a.setCode(codeableConcept1); observation3a.setCode(codeableConcept1);
Coding coding1 = codeableConcept1.addCoding(); Coding coding1 = codeableConcept1.addCoding();
coding1.setCode(code); coding1.setCode(code);
coding1.setSystem("SNOMED-CT"); coding1.setSystem("SNOMED-CT");
ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();
// Should see only one subscription notification // Should see only one subscription notification
Thread.sleep(500); Thread.sleep(500);
@ -202,11 +200,11 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(1, ourUpdatedObservations); waitForSize(1, ourUpdatedObservations);
Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId());
Assert.assertNotNull(subscriptionTemp); Assert.assertNotNull(subscriptionTemp);
subscriptionTemp.setCriteria(criteria1); subscriptionTemp.setCriteria(criteria1);
ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();
Observation observation2 = sendObservation(code, "SNOMED-CT"); Observation observation2 = sendObservation(code, "SNOMED-CT");
@ -216,7 +214,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(3, ourUpdatedObservations); waitForSize(3, ourUpdatedObservations);
ourClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute(); myClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute();
Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); Observation observationTemp3 = sendObservation(code, "SNOMED-CT");
@ -225,27 +223,27 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3 = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept = new CodeableConcept(); CodeableConcept codeableConcept = new CodeableConcept();
observation3.setCode(codeableConcept); observation3.setCode(codeableConcept);
Coding coding = codeableConcept.addCoding(); Coding coding = codeableConcept.addCoding();
coding.setCode(code + "111"); coding.setCode(code + "111");
coding.setSystem("SNOMED-CT"); coding.setSystem("SNOMED-CT");
ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); myClient.update().resource(observation3).withId(observation3.getIdElement()).execute();
// Should see no subscription notification // Should see no subscription notification
waitForQueueToDrain(); waitForQueueToDrain();
waitForSize(0, ourCreatedObservations); waitForSize(0, ourCreatedObservations);
waitForSize(4, ourUpdatedObservations); waitForSize(4, ourUpdatedObservations);
Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); Observation observation3a = myClient.read(Observation.class, observationTemp3.getId());
CodeableConcept codeableConcept1 = new CodeableConcept(); CodeableConcept codeableConcept1 = new CodeableConcept();
observation3a.setCode(codeableConcept1); observation3a.setCode(codeableConcept1);
Coding coding1 = codeableConcept1.addCoding(); Coding coding1 = codeableConcept1.addCoding();
coding1.setCode(code); coding1.setCode(code);
coding1.setSystem("SNOMED-CT"); coding1.setSystem("SNOMED-CT");
ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();
// Should see only one subscription notification // Should see only one subscription notification
waitForQueueToDrain(); waitForQueueToDrain();

View File

@ -52,14 +52,14 @@ public class RestHookWithEventDefinitionR4Test extends BaseResourceProviderR4Tes
@After @After
public void afterUnregisterRestHookListener() { public void afterUnregisterRestHookListener() {
for (IIdType next : mySubscriptionIds) { for (IIdType next : mySubscriptionIds) {
ourClient.delete().resourceById(next).execute(); myClient.delete().resourceById(next).execute();
} }
mySubscriptionIds.clear(); mySubscriptionIds.clear();
myDaoConfig.setAllowMultipleDelete(true); myDaoConfig.setAllowMultipleDelete(true);
ourLog.info("Deleting all subscriptions"); ourLog.info("Deleting all subscriptions");
ourClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); myClient.delete().resourceConditionalByUrl("Subscription?status=active").execute();
ourClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute(); myClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute();
ourLog.info("Done deleting all subscriptions"); ourLog.info("Done deleting all subscriptions");
myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete()); myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete());
@ -83,7 +83,7 @@ public class RestHookWithEventDefinitionR4Test extends BaseResourceProviderR4Tes
*/ */
Patient patient = FhirR4Util.getPatient(); Patient patient = FhirR4Util.getPatient();
MethodOutcome methodOutcome = ourClient.create().resource(patient).execute(); MethodOutcome methodOutcome = myClient.create().resource(patient).execute();
myPatientId = methodOutcome.getId().getIdPart(); myPatientId = methodOutcome.getId().getIdPart();
/* /*
@ -114,7 +114,7 @@ public class RestHookWithEventDefinitionR4Test extends BaseResourceProviderR4Tes
channel.setPayload("application/json"); channel.setPayload("application/json");
subscription.setChannel(channel); subscription.setChannel(channel);
methodOutcome = ourClient.create().resource(subscription).execute(); methodOutcome = myClient.create().resource(subscription).execute();
mySubscriptionId = methodOutcome.getId().getIdPart(); mySubscriptionId = methodOutcome.getId().getIdPart();
} }

View File

@ -49,7 +49,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test {
*/ */
Patient patient = FhirR4Util.getPatient(); Patient patient = FhirR4Util.getPatient();
MethodOutcome methodOutcome = ourClient.create().resource(patient).execute(); MethodOutcome methodOutcome = myClient.create().resource(patient).execute();
myPatientId = methodOutcome.getId().getIdPart(); myPatientId = methodOutcome.getId().getIdPart();
/* /*
@ -66,7 +66,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test {
channel.setPayload("application/json"); channel.setPayload("application/json");
subscription.setChannel(channel); subscription.setChannel(channel);
methodOutcome = ourClient.create().resource(subscription).execute(); methodOutcome = myClient.create().resource(subscription).execute();
mySubscriptionId = methodOutcome.getId().getIdPart(); mySubscriptionId = methodOutcome.getId().getIdPart();
/* /*
@ -105,7 +105,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test {
observation.setSubject(reference); observation.setSubject(reference);
observation.setStatus(Observation.ObservationStatus.FINAL); observation.setStatus(Observation.ObservationStatus.FINAL);
MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute();
String observationId = methodOutcome2.getId().getIdPart(); String observationId = methodOutcome2.getId().getIdPart();
observation.setId(observationId); observation.setId(observationId);
@ -129,7 +129,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test {
observation.setSubject(reference); observation.setSubject(reference);
observation.setStatus(Observation.ObservationStatus.FINAL); observation.setStatus(Observation.ObservationStatus.FINAL);
MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute();
String observationId = methodOutcome2.getId().getIdPart(); String observationId = methodOutcome2.getId().getIdPart();
observation.setId(observationId); observation.setId(observationId);

View File

@ -72,7 +72,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes
*/ */
Patient patient = FhirR4Util.getPatient(); Patient patient = FhirR4Util.getPatient();
MethodOutcome methodOutcome = ourClient.create().resource(patient).execute(); MethodOutcome methodOutcome = myClient.create().resource(patient).execute();
myPatientId = methodOutcome.getId().getIdPart(); myPatientId = methodOutcome.getId().getIdPart();
/* /*
@ -89,7 +89,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes
channel.setPayload("application/json"); channel.setPayload("application/json");
subscription.setChannel(channel); subscription.setChannel(channel);
methodOutcome = ourClient.create().resource(subscription).execute(); methodOutcome = myClient.create().resource(subscription).execute();
mySubscriptionId = methodOutcome.getId().getIdPart(); mySubscriptionId = methodOutcome.getId().getIdPart();
/* /*
@ -122,7 +122,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes
observation.setSubject(reference); observation.setSubject(reference);
observation.setStatus(Observation.ObservationStatus.FINAL); observation.setStatus(Observation.ObservationStatus.FINAL);
MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute();
String observationId = methodOutcome2.getId().getIdPart(); String observationId = methodOutcome2.getId().getIdPart();
observation.setId(observationId); observation.setId(observationId);
@ -146,7 +146,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes
observation.setSubject(reference); observation.setSubject(reference);
observation.setStatus(Observation.ObservationStatus.FINAL); observation.setStatus(Observation.ObservationStatus.FINAL);
MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute();
String observationId = methodOutcome2.getId().getIdPart(); String observationId = methodOutcome2.getId().getIdPart();
observation.setId(observationId); observation.setId(observationId);

View File

@ -64,7 +64,7 @@
</li> </li>
<!-- CRUD Tab --> <!-- CRUD Tab -->
<li th:class="(${!haveSearchParams} and ${queries.empty}) ? 'active'"> <li th:class="(${!haveSearchParams} and ${queries.empty}) ? 'active'">
<a href="#tab-otheractions" role="tab" data-toggle="tab">CRUD Operations</a> <a href="#tab-otheractions" role="tab" data-toggle="tab" name="tabCrudOperationsLink">CRUD Operations</a>
</li> </li>
<!-- Tags Tab --> <!-- Tags Tab -->
<li> <li>

12
pom.xml
View File

@ -425,32 +425,32 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.8.1</version> <version>2.9.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.8.1</version> <version>2.9.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.8.1</version> <version>2.9.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-datatype-jsr310</artifactId>
<version>2.8.1</version> <version>2.9.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId> <artifactId>jackson-dataformat-yaml</artifactId>
<version>2.8.1</version> <version>2.9.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.module</groupId> <groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId> <artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.8.1</version> <version>2.9.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.icegreen</groupId> <groupId>com.icegreen</groupId>

View File

@ -13,6 +13,7 @@
<![CDATA[ <![CDATA[
<ul> <ul>
<li>Spring (JPA): 4.3.10 -&gt; 5.0.0</li> <li>Spring (JPA): 4.3.10 -&gt; 5.0.0</li>
<li>Jackson (JPA): 2.8.1 -&gt; 2.9.2</li>
</ul> </ul>
]]> ]]>
</action> </action>