From 1d9641a7361178d1c72cf37e6aa78da662ffaed3 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 25 Jun 2020 10:28:03 -0700 Subject: [PATCH] fix empilinks --- .../jpa/bulk/BulkDataExportSvcImplR4Test.java | 7 +++---- .../jpa/empi/svc/EmpiPersonMergerSvcTest.java | 17 +++++++++-------- .../ca/uhn/fhir/jpa/config/TestJpaConfig.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java index 08a1af4e4bf..29327f980f0 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java @@ -25,7 +25,6 @@ import org.hl7.fhir.r4.model.Patient; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.batch.core.BatchStatus; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; @@ -341,9 +340,9 @@ public class BulkDataExportSvcImplR4Test extends BaseJpaR4Test { //create one itself, which means that its jobUUID isnt known until it starts. to get around this, we move public void awaitJobCompletion(JobExecution theJobExecution) throws InterruptedException { await().until(() -> { - return theJobExecution.getStatus() == BatchStatus.COMPLETED; - //String jobUUID = theJobExecution.getExecutionContext().getString("jobUUID"); - //return myBulkDataExportSvc.getJobInfoOrThrowResourceNotFound(jobUUID).getStatus() == BulkJobStatusEnum.COMPLETE; + //return theJobExecution.getStatus() == BatchStatus.COMPLETED; + String jobUUID = theJobExecution.getExecutionContext().getString("jobUUID"); + return myBulkDataExportSvc.getJobInfoOrThrowResourceNotFound(jobUUID).getStatus() == BulkJobStatusEnum.COMPLETE; }); } diff --git a/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/svc/EmpiPersonMergerSvcTest.java b/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/svc/EmpiPersonMergerSvcTest.java index f9f15933fe1..65798826787 100644 --- a/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/svc/EmpiPersonMergerSvcTest.java +++ b/hapi-fhir-jpaserver-empi/src/test/java/ca/uhn/fhir/jpa/empi/svc/EmpiPersonMergerSvcTest.java @@ -108,7 +108,7 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test { @Test public void mergeRemovesPossibleDuplicatesLink() { EmpiLink empiLink = new EmpiLink().setPersonPid(myToPersonPid).setTargetPid(myFromPersonPid).setMatchResult(EmpiMatchResultEnum.POSSIBLE_DUPLICATE).setLinkSource(EmpiLinkSourceEnum.AUTO); - myEmpiLinkDaoSvc.save(empiLink); + saveLink(empiLink); assertEquals(1, myEmpiLinkDao.count()); mergePersons(); assertEquals(0, myEmpiLinkDao.count()); @@ -179,7 +179,8 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test { EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1); fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); fromLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH); - myEmpiLinkDaoSvc.save(fromLink); + + saveLink(fromLink); createEmpiLink(myToPerson, myTargetPatient1); @@ -196,7 +197,7 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test { EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient1); toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); toLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH); - myEmpiLinkDaoSvc.save(toLink); + saveLink(toLink); mergePersons(); List links = myEmpiLinkDaoSvc.findEmpiLinksByPersonId(myToPerson); @@ -209,7 +210,7 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test { EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1); fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); fromLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH); - myEmpiLinkDaoSvc.save(fromLink); + saveLink(fromLink); EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient1); toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); @@ -229,12 +230,12 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test { EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1); fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); fromLink.setMatchResult(EmpiMatchResultEnum.MATCH); - myEmpiLinkDaoSvc.save(fromLink); + saveLink(fromLink); EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient1); toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); toLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH); - myEmpiLinkDaoSvc.save(toLink); + saveLink(toLink); try { mergePersons(); @@ -249,12 +250,12 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test { EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1); fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); fromLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH); - myEmpiLinkDaoSvc.save(fromLink); + saveLink(fromLink); EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient2); toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL); toLink.setMatchResult(EmpiMatchResultEnum.MATCH); - myEmpiLinkDaoSvc.save(toLink); + saveLink(toLink); mergePersons(); assertEquals(1, myToPerson.getLink().size()); diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/config/TestJpaConfig.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/config/TestJpaConfig.java index 1ba10db64c7..0df218c7224 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/config/TestJpaConfig.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/config/TestJpaConfig.java @@ -45,7 +45,7 @@ public class TestJpaConfig { @Bean @Primary - public JpaTransactionManager hapiTransactionManager(EntityManagerFactory entityManagerFactory) { + public JpaTransactionManager hapiransactionManager(EntityManagerFactory entityManagerFactory) { JpaTransactionManager retVal = new JpaTransactionManager(); retVal.setEntityManagerFactory(entityManagerFactory); return retVal;