From ed155e7657ad108b09e38f967fad2cddbabc7082 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 25 Jun 2020 10:37:02 -0700 Subject: [PATCH] wip --- .../ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java | 5 ++--- .../src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java | 2 +- .../src/main/java/ca/uhn/fhir/jpa/config/TestJpaConfig.java | 2 +- 3 files changed, 4 insertions(+), 5 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 29327f980f0..4ec4ba81c09 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,6 +25,7 @@ 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; @@ -340,9 +341,7 @@ 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; }); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java index db9f1a5add5..8dbe1d26e62 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java @@ -44,7 +44,7 @@ public class TestR4Config extends BaseJavaConfigR4 { * starvation */ if (ourMaxThreads == null) { - ourMaxThreads = (int) (Math.random() * 6.0) + 2; + ourMaxThreads = (int) (Math.random() * 6.0) + 3; if ("true".equals(System.getProperty("single_db_connection"))) { ourMaxThreads = 1; 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 0df218c7224..1ba10db64c7 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 hapiransactionManager(EntityManagerFactory entityManagerFactory) { + public JpaTransactionManager hapiTransactionManager(EntityManagerFactory entityManagerFactory) { JpaTransactionManager retVal = new JpaTransactionManager(); retVal.setEntityManagerFactory(entityManagerFactory); return retVal;