diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index a0115b45e17..6b647d48e6e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -41,7 +41,6 @@ import ca.uhn.fhir.jpa.delete.DeleteConflictUtil; import ca.uhn.fhir.jpa.model.entity.BaseHasResource; import ca.uhn.fhir.jpa.model.entity.BaseTag; import ca.uhn.fhir.jpa.model.entity.ForcedId; -import ca.uhn.fhir.jpa.model.entity.PartitionablePartitionId; import ca.uhn.fhir.jpa.model.entity.ResourceHistoryTable; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.model.entity.TagDefinition; @@ -259,9 +258,7 @@ public abstract class BaseHapiFhirResourceDao extends B ResourceTable entity = new ResourceTable(); entity.setResourceType(toResourceName(theResource)); - PartitionablePartitionId partitionablePartitionId = myRequestPartitionHelperService.toStoragePartition(theRequestPartitionId); - ourLog.info("Setting Entity for resource {} to partition id {} which has date {}", theResource, partitionablePartitionId, partitionablePartitionId.getPartitionDate()); - entity.setPartitionId(partitionablePartitionId); + entity.setPartitionId(myRequestPartitionHelperService.toStoragePartition(theRequestPartitionId)); entity.setCreatedByMatchUrl(theIfNoneExist); entity.setVersion(1); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BasePartitioningR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BasePartitioningR4Test.java index 9ab6f19a77c..988b413c6f9 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BasePartitioningR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BasePartitioningR4Test.java @@ -229,7 +229,7 @@ public abstract class BasePartitioningR4Test extends BaseJpaR4SystemTest { assertNotNull(theResource); assertTrue(!myCreateRequestPartitionIds.isEmpty(), "No create partitions left in interceptor"); RequestPartitionId retVal = myCreateRequestPartitionIds.remove(0); - ourLog.info("Returning partition [{}] for create of resource {} with date {}", retVal, theResource, retVal.getPartitionDate()); + ourLog.debug("Returning partition [{}] for create of resource {} with date {}", retVal, theResource, retVal.getPartitionDate()); return retVal; } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java index f306d52043e..e894bb17d13 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java @@ -752,7 +752,7 @@ public class FhirResourceDaoR4SearchWithElasticSearchIT extends BaseJpaTest { } - /*@Nested + @Nested public class DateSearchTests extends BaseDateSearchDaoTests { @Override @@ -760,6 +760,6 @@ public class FhirResourceDaoR4SearchWithElasticSearchIT extends BaseJpaTest { DaoTestDataBuilder testDataBuilder = new DaoTestDataBuilder(myFhirCtx, myDaoRegistry, new SystemRequestDetails()); return new TestDataBuilderFixture<>(testDataBuilder, myObservationDao); } - }*/ + } } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java index 3077d6657c7..b472c6f99e9 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java @@ -8,7 +8,6 @@ import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao; -import ca.uhn.fhir.jpa.dao.BaseJpaTest; import ca.uhn.fhir.jpa.model.config.PartitionSettings; import ca.uhn.fhir.jpa.model.entity.ForcedId; import ca.uhn.fhir.jpa.model.entity.PartitionablePartitionId; @@ -67,7 +66,6 @@ import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.test.context.TestPropertySource; import java.util.Date; import java.util.List; @@ -623,8 +621,7 @@ public class PartitioningSqlR4Test extends BasePartitioningR4Test { public void testCreateInTransaction_ServerId_WithPartition() { createUniqueCompositeSp(); createRequestId(); - ourLog.info("Starting testCreateInTransaction_ServerId_WithPartition"); - ourLog.info("Setting up partitionId {} with date {}", myPartitionId, myPartitionDate); + addCreatePartition(myPartitionId, myPartitionDate); addCreatePartition(myPartitionId, myPartitionDate); addCreatePartition(myPartitionId, myPartitionDate); @@ -658,9 +655,6 @@ public class PartitioningSqlR4Test extends BasePartitioningR4Test { runInTransaction(() -> { // HFJ_RESOURCE ResourceTable resourceTable = myResourceTableDao.findById(patientId).orElseThrow(IllegalArgumentException::new); - ourLog.info("Found resourceTable {}, which contains partition id {} with date {}", resourceTable.getId(), resourceTable.getPartitionId(), resourceTable.getPartitionId().getPartitionDate()); - ourLog.info("in test: myPartitionDate = {}", myPartitionDate); - ourLog.info("in test: resourceTablePartDate = {}", resourceTable.getPartitionId().getPartitionDate()); assertEquals(myPartitionId, resourceTable.getPartitionId().getPartitionId().intValue()); assertEquals(myPartitionDate, resourceTable.getPartitionId().getPartitionDate()); }); diff --git a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/dao/BaseDateSearchDaoTests.java b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/dao/BaseDateSearchDaoTests.java index 0050052424b..f117e5b73dc 100644 --- a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/dao/BaseDateSearchDaoTests.java +++ b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/dao/BaseDateSearchDaoTests.java @@ -8,8 +8,6 @@ import ca.uhn.fhir.rest.param.DateParam; import ca.uhn.fhir.test.utilities.ITestDataBuilder; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -17,7 +15,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; -import java.util.TimeZone; import java.util.stream.Collectors; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -33,18 +30,6 @@ public abstract class BaseDateSearchDaoTests { */ IIdType myObservationId; - //time zone set to EST - @BeforeEach - public void setTimeZoneEST() { - TimeZone.setDefault(TimeZone.getTimeZone("EST")); - } - - //reset time zone back to match the system - @AfterEach - public void resetTimeZone() { - TimeZone.setDefault(null); - } - /** * Test for our date search operators. *