From 3a736924f12f09f3839defc5a799642517e433a7 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Mon, 29 Apr 2019 10:49:32 -0400 Subject: [PATCH 1/4] fixed delete reference error message --- src/changes/changes.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index fd87aa39108..aae339eb517 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -190,6 +190,10 @@ Expunges are now done in batches in multiple threads. Both the number of expunge threads and batch size are configurable in DaoConfig. + + Fixed "because at least one resource has a reference to this resource" delete error message that mistakingly reported + the target instead of the source with the reference. + From b860269eb9441d0b9011257c8f2b3425ecf52fbc Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Mon, 29 Apr 2019 11:12:08 -0400 Subject: [PATCH 2/4] fix broken test --- .../jpa/dao/r4/FhirResourceDaoR4ReferentialIntegrityTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ReferentialIntegrityTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ReferentialIntegrityTest.java index da97ccd3d21..51a5bc74b06 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ReferentialIntegrityTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ReferentialIntegrityTest.java @@ -70,7 +70,7 @@ public class FhirResourceDaoR4ReferentialIntegrityTest extends BaseJpaR4Test { myOrganizationDao.delete(oid); fail(); } catch (ResourceVersionConflictException e) { - assertEquals("Unable to delete Organization/"+oid.getIdPart()+" because at least one resource has a reference to this resource. First reference found was resource Organization/"+oid.getIdPart()+" in path Patient.managingOrganization", e.getMessage()); + assertEquals("Unable to delete Organization/"+oid.getIdPart()+" because at least one resource has a reference to this resource. First reference found was resource Patient/"+pid.getIdPart()+" in path Patient.managingOrganization", e.getMessage()); } myPatientDao.delete(pid); From 8fbd7a1aa1391c1bf5249ec006f85837cfa3f0c2 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Mon, 29 Apr 2019 12:02:02 -0400 Subject: [PATCH 3/4] fix duplicate class build error --- hapi-fhir-jpaserver-migrate/pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hapi-fhir-jpaserver-migrate/pom.xml b/hapi-fhir-jpaserver-migrate/pom.xml index 3eff9239bdb..5e17f3daf54 100644 --- a/hapi-fhir-jpaserver-migrate/pom.xml +++ b/hapi-fhir-jpaserver-migrate/pom.xml @@ -60,12 +60,6 @@ test - - com.intellij - annotations - 12.0 - - From 0feb3f5932d14b3e6cf5b51e5a90462beb0bfd76 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Mon, 29 Apr 2019 14:38:58 -0400 Subject: [PATCH 4/4] register subscription interceptors on uhn test server --- .../src/main/java/ca/uhn/fhirtest/TestRestfulServer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java index 0b8c67b5eac..8a13de117bc 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java @@ -13,6 +13,7 @@ import ca.uhn.fhir.jpa.provider.r4.JpaConformanceProviderR4; import ca.uhn.fhir.jpa.provider.r4.JpaSystemProviderR4; import ca.uhn.fhir.jpa.provider.r4.TerminologyUploaderProviderR4; import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider; +import ca.uhn.fhir.jpa.subscription.SubscriptionInterceptorLoader; import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.server.*; @@ -225,6 +226,12 @@ public class TestRestfulServer extends RestfulServer { * Spool results to the database */ setPagingProvider(myAppCtx.getBean(DatabaseBackedPagingProvider.class)); + + /* + * Register subscription interceptors + */ + SubscriptionInterceptorLoader subscriptionInterceptorLoader = myAppCtx.getBean(SubscriptionInterceptorLoader.class); + subscriptionInterceptorLoader.registerInterceptors(); } /**