From 4d3cecaab289bc5327cd2a3f7bf9a8f19be93e72 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Sat, 1 Aug 2020 11:12:28 -0700 Subject: [PATCH] Fix pointcutlatch issue --- .../uhn/fhir/jpa/empi/config/EmpiConsumerConfig.java | 1 - .../jpa/empi/provider/EmpiProviderBatchR4Test.java | 10 +++++----- .../java/ca/uhn/test/concurrency/PointcutLatch.java | 9 ++------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/hapi-fhir-jpaserver-empi/src/main/java/ca/uhn/fhir/jpa/empi/config/EmpiConsumerConfig.java b/hapi-fhir-jpaserver-empi/src/main/java/ca/uhn/fhir/jpa/empi/config/EmpiConsumerConfig.java index f11de138404..31da550d51a 100644 --- a/hapi-fhir-jpaserver-empi/src/main/java/ca/uhn/fhir/jpa/empi/config/EmpiConsumerConfig.java +++ b/hapi-fhir-jpaserver-empi/src/main/java/ca/uhn/fhir/jpa/empi/config/EmpiConsumerConfig.java @@ -86,7 +86,6 @@ public class EmpiConsumerConfig { return new EmpiMatchLinkSvc(); } - @Bean EmpiEidUpdateService eidUpdateService() { return new EmpiEidUpdateService(); diff --git a/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/provider/EmpiProviderBatchR4Test.java b/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/provider/EmpiProviderBatchR4Test.java index a067eaeb4b2..cb486ef00fb 100644 --- a/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/provider/EmpiProviderBatchR4Test.java +++ b/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/provider/EmpiProviderBatchR4Test.java @@ -50,7 +50,7 @@ public class EmpiProviderBatchR4Test extends BaseLinkR4Test { } @Test - public void testBatchRunOnAllPractitioners() { + public void testBatchRunOnAllPractitioners() throws InterruptedException { StringType criteria = null; myEmpiProviderR4.clearEmpiLinks(null); @@ -58,7 +58,7 @@ public class EmpiProviderBatchR4Test extends BaseLinkR4Test { assertLinkCount(1); } @Test - public void testBatchRunOnSpecificPractitioner() { + public void testBatchRunOnSpecificPractitioner() throws InterruptedException { myEmpiProviderR4.clearEmpiLinks(null); afterEmpiLatch.runWithExpectedCount(1, () -> myEmpiProviderR4.empiBatchPractitionerInstance(myPractitioner.getIdElement(), null)); assertLinkCount(1); @@ -74,7 +74,7 @@ public class EmpiProviderBatchR4Test extends BaseLinkR4Test { } @Test - public void testBatchRunOnAllPatients() { + public void testBatchRunOnAllPatients() throws InterruptedException { assertLinkCount(2); StringType criteria = null; myEmpiProviderR4.clearEmpiLinks(null); @@ -83,7 +83,7 @@ public class EmpiProviderBatchR4Test extends BaseLinkR4Test { } @Test - public void testBatchRunOnSpecificPatient() { + public void testBatchRunOnSpecificPatient() throws InterruptedException { assertLinkCount(2); myEmpiProviderR4.clearEmpiLinks(null); afterEmpiLatch.runWithExpectedCount(1, () -> myEmpiProviderR4.empiBatchPatientInstance(myPatient.getIdElement(), null)); @@ -101,7 +101,7 @@ public class EmpiProviderBatchR4Test extends BaseLinkR4Test { } @Test - public void testBatchRunOnAllTypes() { + public void testBatchRunOnAllTypes() throws InterruptedException { assertLinkCount(2); StringType criteria = new StringType(""); myEmpiProviderR4.clearEmpiLinks(null); diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/concurrency/PointcutLatch.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/concurrency/PointcutLatch.java index 977cf1fb5e1..88d84458632 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/concurrency/PointcutLatch.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/concurrency/PointcutLatch.java @@ -67,15 +67,10 @@ public class PointcutLatch implements IAnonymousInterceptor, IPointcutLatch { myPointcut = null; } - public void runWithExpectedCount(int theExpectedCount, Runnable r) { + public void runWithExpectedCount(int theExpectedCount, Runnable r) throws InterruptedException { this.setExpectedCount(theExpectedCount); r.run(); - try { - this.awaitExpected(); - } catch (InterruptedException theE) { - ourLog.error("InterruptedException while awaiting invocation of {}", this.myPointcut.name()); - theE.printStackTrace(); - } + this.awaitExpected(); } public long getLastInvoke() {