From 878e27b06d295c3c0879e3fd88d9f85275985e74 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Sun, 14 Jan 2024 14:15:08 -0500 Subject: [PATCH] HAPI FHIR Dependency Bumps (#5576) * HAPI FHIR Dependency Bumps * Hibernate search 6 * Dep bumps * Bump mockito * Fix memory leak * Test cleanup * Test fix * Test fixes * Test fix * Test fix * Test fix * Test fix * Prepare to try and rework max clauses * Refactor large VS expansion * Spotless * Test fix * Version bump * Test fixes * Bump maven container * Build fix * Add license headers * Version bump * License headers --- hapi-deployable-pom/pom.xml | 2 +- hapi-fhir-android/pom.xml | 2 +- .../android/client/GenericClientDstu3IT.java | 2 +- hapi-fhir-base/pom.xml | 2 +- .../model/api/BaseBatchJobParameters.java | 19 ++ hapi-fhir-bom/pom.xml | 4 +- hapi-fhir-checkstyle/pom.xml | 2 +- hapi-fhir-cli/hapi-fhir-cli-api/pom.xml | 2 +- hapi-fhir-cli/hapi-fhir-cli-app/pom.xml | 2 +- hapi-fhir-cli/pom.xml | 2 +- hapi-fhir-client-okhttp/pom.xml | 2 +- hapi-fhir-client/pom.xml | 2 +- hapi-fhir-converter/pom.xml | 2 +- hapi-fhir-dist/pom.xml | 2 +- hapi-fhir-docs/pom.xml | 2 +- .../hapi/fhir/changelog/7_0_0/changes.yaml | 10 +- hapi-fhir-jacoco/pom.xml | 2 +- hapi-fhir-jaxrsserver-base/pom.xml | 2 +- hapi-fhir-jpa/pom.xml | 4 +- hapi-fhir-jpaserver-base/pom.xml | 8 +- .../export/svc/JpaBulkExportProcessor.java | 2 +- .../fhir/jpa/dao/index/IdHelperService.java | 4 +- .../jpa/search/SynchronousSearchSvcImpl.java | 2 +- .../ca/uhn/fhir/jpa/term/TermReadSvcImpl.java | 268 +++++++++--------- .../svc/JpaBulkExportProcessorTest.java | 7 + .../pom.xml | 2 +- hapi-fhir-jpaserver-hfql/pom.xml | 2 +- hapi-fhir-jpaserver-ips/pom.xml | 2 +- hapi-fhir-jpaserver-mdm/pom.xml | 2 +- hapi-fhir-jpaserver-model/pom.xml | 4 +- hapi-fhir-jpaserver-searchparam/pom.xml | 4 +- hapi-fhir-jpaserver-subscription/pom.xml | 2 +- hapi-fhir-jpaserver-test-dstu2/pom.xml | 2 +- .../search/SynchronousSearchSvcImplTest.java | 1 + hapi-fhir-jpaserver-test-dstu3/pom.xml | 2 +- hapi-fhir-jpaserver-test-r4/pom.xml | 2 +- .../RestHookWithInterceptorR4Test.java | 11 +- hapi-fhir-jpaserver-test-r4b/pom.xml | 2 +- hapi-fhir-jpaserver-test-r5/pom.xml | 2 +- hapi-fhir-jpaserver-test-utilities/pom.xml | 6 +- .../BaseValueSetHSearchExpansionR4Test.java | 60 ++-- .../ResourceVersionSvcTest.java | 9 +- hapi-fhir-jpaserver-uhnfhirtest/pom.xml | 2 +- hapi-fhir-server-cds-hooks/pom.xml | 2 +- .../svc/CdsHooksContextBooterTest.java | 2 +- hapi-fhir-server-mdm/pom.xml | 2 +- hapi-fhir-server-openapi/pom.xml | 2 +- hapi-fhir-server/pom.xml | 2 +- .../hapi-fhir-caching-api/pom.xml | 2 +- .../hapi-fhir-caching-caffeine/pom.xml | 4 +- .../hapi-fhir-caching-guava/pom.xml | 2 +- .../hapi-fhir-caching-testing/pom.xml | 2 +- hapi-fhir-serviceloaders/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../hapi-fhir-spring-boot-samples/pom.xml | 2 +- .../hapi-fhir-spring-boot-starter/pom.xml | 2 +- hapi-fhir-spring-boot/pom.xml | 2 +- hapi-fhir-sql-migrate/pom.xml | 2 +- .../jpa/migrate/taskdef/DropTableTask.java | 9 + hapi-fhir-storage-batch2-jobs/pom.xml | 2 +- .../ExpandResourceAndWriteBinaryStep.java | 6 + .../jobs/export/ExpandResourcesStep.java | 6 + .../jobs/export/FetchResourceIdsStep.java | 6 + .../ExpandResourceAndWriteBinaryStepTest.java | 1 + .../jobs/export/ExpandResourcesStepTest.java | 6 + .../jobs/export/FetchResourceIdsStepTest.java | 1 + .../pom.xml | 2 +- hapi-fhir-storage-batch2/pom.xml | 2 +- hapi-fhir-storage-cr/pom.xml | 2 +- .../r4/ILibraryEvaluationServiceFactory.java | 19 ++ .../LibraryEvaluationOperationProvider.java | 19 ++ hapi-fhir-storage-mdm/pom.xml | 2 +- hapi-fhir-storage-test-utilities/pom.xml | 2 +- hapi-fhir-storage/pom.xml | 10 +- hapi-fhir-structures-dstu2.1/pom.xml | 2 +- hapi-fhir-structures-dstu2/pom.xml | 2 +- hapi-fhir-structures-dstu3/pom.xml | 2 +- hapi-fhir-structures-hl7org-dstu2/pom.xml | 2 +- hapi-fhir-structures-r4/pom.xml | 2 +- hapi-fhir-structures-r4b/pom.xml | 2 +- hapi-fhir-structures-r5/pom.xml | 2 +- hapi-fhir-test-utilities/pom.xml | 4 +- .../utilities/server/MockServletUtil.java | 4 +- hapi-fhir-testpage-overlay/pom.xml | 2 +- .../pom.xml | 2 +- hapi-fhir-validation-resources-dstu2/pom.xml | 2 +- hapi-fhir-validation-resources-dstu3/pom.xml | 2 +- hapi-fhir-validation-resources-r4/pom.xml | 2 +- hapi-fhir-validation-resources-r4b/pom.xml | 2 +- hapi-fhir-validation-resources-r5/pom.xml | 2 +- hapi-fhir-validation/pom.xml | 2 +- .../BaseValidationTestWithInlineMocks.java | 21 ++ .../ca/uhn/fhir/fhirpath/FhirPathTest.java | 4 +- ...RequestValidatingInterceptorDstu3Test.java | 13 +- .../RequestValidatingInterceptorR4Test.java | 3 +- ...esponseValidatingInterceptorDstu3Test.java | 3 +- .../ResponseValidatingInterceptorR4Test.java | 3 +- ...rverCapabilityStatementProviderR4Test.java | 9 +- ...ologyDisplayPopulationInterceptorTest.java | 3 +- .../auth/AuthorizationInterceptorR4Test.java | 3 +- .../HapiFhirCodeSystemGeneratorTest.java | 3 +- .../ParserWithValidationDstu3Test.java | 3 +- .../validation/SchemaBaseValidatorTest.java | 3 +- .../support/CachingValidationSupportTest.java | 5 +- ...mmonCodeSystemsTerminologyServiceTest.java | 3 +- ...erminologyServerValidationSupportTest.java | 3 +- .../PrePopulatedValidationSupportTest.java | 3 +- .../support/ValidationSupportChainTest.java | 9 +- ...rsionSpecificWorkerContextWrapperTest.java | 7 +- .../FhirInstanceValidatorDstu2Test.java | 3 +- .../ResourceValidatorDstu2_1Test.java | 3 +- .../dstu3/elementmodel/PropertyDstu3Test.java | 3 +- ...DefaultProfileValidationSupportR4Test.java | 3 +- ...DefaultProfileValidationSupportR5Test.java | 3 +- .../FhirInstanceValidatorDstu3Test.java | 12 +- ...estionnaireResponseValidatorDstu3Test.java | 8 +- .../QuestionnaireValidatorDstu3Test.java | 3 +- .../ResourceValidatorDstu3Test.java | 17 +- .../validation/SchemaValidationDstu3Test.java | 3 +- ...atronValidationDstu3QuestionnaireTest.java | 3 +- .../hapi/validation/StructureMapTest.java | 3 +- .../fhir/dstu3/utils/FhirPathEngineTest.java | 4 +- .../fhir/r4/utils/FhirPathEngineR4Test.java | 3 +- .../CustomResourceGenerationTest.java | 6 +- .../FHIRPathResourceGeneratorR4Test.java | 3 +- .../FhirInstanceValidatorR4Test.java | 4 +- .../r4/validation/HapiWorkerContextTest.java | 4 +- .../LocalFileValidationSupportTest.java | 14 +- .../NpmPackageValidationSupportTest.java | 5 +- .../ParserWithValidationR4Test.java | 7 +- .../QuestionnaireResponseValidatorR4Test.java | 27 +- .../QuestionnaireValidatorR4Test.java | 3 +- ...inologyServiceValidationSupportR4Test.java | 3 +- .../r4/validation/SchemaValidationR4Test.java | 4 +- .../validation/SnapshotGeneratorR4Test.java | 5 +- .../XverExtensionsValidationTest.java | 8 +- .../FhirInstanceValidatorR4BTest.java | 4 +- .../fhir/r5/utils/GraphQLEngineR5Test.java | 3 +- .../FhirInstanceValidatorR5Test.java | 5 +- .../QuestionnaireResponseValidatorR5Test.java | 8 +- ...inologyServiceValidationSupportR5Test.java | 3 +- hapi-tinder-plugin/pom.xml | 2 +- hapi-tinder-test/pom.xml | 2 +- pom.xml | 32 +-- release-pipeline.yml | 14 +- snapshot-pipeline.yml | 4 +- test-job-template.yml | 12 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- 153 files changed, 584 insertions(+), 422 deletions(-) rename hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/{dao/index => cache}/ResourceVersionSvcTest.java (96%) create mode 100644 hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/BaseValidationTestWithInlineMocks.java diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml index 4b0e42eb6442..dec1bbf3cda3 100644 --- a/hapi-deployable-pom/pom.xml +++ b/hapi-deployable-pom/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml index 580d6d606fab..233cd5538750 100644 --- a/hapi-fhir-android/pom.xml +++ b/hapi-fhir-android/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-android/src/test/java/ca/uhn/fhir/android/client/GenericClientDstu3IT.java b/hapi-fhir-android/src/test/java/ca/uhn/fhir/android/client/GenericClientDstu3IT.java index 0e26ddc57627..ccd2ba18a739 100644 --- a/hapi-fhir-android/src/test/java/ca/uhn/fhir/android/client/GenericClientDstu3IT.java +++ b/hapi-fhir-android/src/test/java/ca/uhn/fhir/android/client/GenericClientDstu3IT.java @@ -209,7 +209,7 @@ public void testBinaryCreateWithNoContentType() throws Exception { @Test public void testClientFailures() { ResponseBody body = mock(ResponseBody.class); - when(body.source()).thenThrow(IllegalStateException.class, RuntimeException.class); + when(body.byteStream()).thenThrow(IllegalStateException.class, RuntimeException.class); myHttpResponse = new Response.Builder() .request(myRequest) diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index 31126260bdc2..830c0e393f8e 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseBatchJobParameters.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseBatchJobParameters.java index 9763929b677d..32cb20cc4aeb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseBatchJobParameters.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseBatchJobParameters.java @@ -1,3 +1,22 @@ +/*- + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2024 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ package ca.uhn.fhir.model.api; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/hapi-fhir-bom/pom.xml b/hapi-fhir-bom/pom.xml index fd5829b17d18..a7c8dcd61a69 100644 --- a/hapi-fhir-bom/pom.xml +++ b/hapi-fhir-bom/pom.xml @@ -4,7 +4,7 @@ 4.0.0 ca.uhn.hapi.fhir hapi-fhir-bom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT pom HAPI FHIR BOM @@ -12,7 +12,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-checkstyle/pom.xml b/hapi-fhir-checkstyle/pom.xml index c8b20415e062..6e2c78e46cb0 100644 --- a/hapi-fhir-checkstyle/pom.xml +++ b/hapi-fhir-checkstyle/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml index 0f073dfa0214..fc75658ef53a 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml +++ b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml index 537ad538ccb4..39eff7fbcdde 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml +++ b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-fhir-cli - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml index 3e8db6620c02..1ce5e5d7c18d 100644 --- a/hapi-fhir-cli/pom.xml +++ b/hapi-fhir-cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml index 39f2c4dba8ce..277a861117b3 100644 --- a/hapi-fhir-client-okhttp/pom.xml +++ b/hapi-fhir-client-okhttp/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml index 154e1f5cc46a..31ca234fadfd 100644 --- a/hapi-fhir-client/pom.xml +++ b/hapi-fhir-client/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml index 6971a232d730..cf55ea1c828e 100644 --- a/hapi-fhir-converter/pom.xml +++ b/hapi-fhir-converter/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml index 8bb39f00d175..80eae680de3b 100644 --- a/hapi-fhir-dist/pom.xml +++ b/hapi-fhir-dist/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-docs/pom.xml b/hapi-fhir-docs/pom.xml index d6ff853e9ce8..8190f9e22ff3 100644 --- a/hapi-fhir-docs/pom.xml +++ b/hapi-fhir-docs/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml index dae1d7e2967e..92b26b05b053 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml @@ -4,20 +4,24 @@ title: "The version of a few dependencies have been bumped to the latest versions (dependent HAPI modules listed in brackets): " diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml index d66e4ea7140f..6314ad868af7 100644 --- a/hapi-fhir-jacoco/pom.xml +++ b/hapi-fhir-jacoco/pom.xml @@ -11,7 +11,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml index dbbd5fb8c436..6997b0d63fbf 100644 --- a/hapi-fhir-jaxrsserver-base/pom.xml +++ b/hapi-fhir-jaxrsserver-base/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpa/pom.xml b/hapi-fhir-jpa/pom.xml index 390647a131f2..9e3137bc918e 100644 --- a/hapi-fhir-jpa/pom.xml +++ b/hapi-fhir-jpa/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -53,7 +53,7 @@ org.hibernate.search - hibernate-search-mapper-orm-orm6 + hibernate-search-mapper-orm org.apache.logging.log4j diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index 8e624d49e0a5..fb770122e827 100644 --- a/hapi-fhir-jpaserver-base/pom.xml +++ b/hapi-fhir-jpaserver-base/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -340,11 +340,7 @@ org.apache.lucene - lucene-analyzers-phonetic - - - org.apache.lucene - lucene-backward-codecs + lucene-analysis-phonetic diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java index 92ed2f8cd4de..d5e1ce78fcba 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java @@ -111,7 +111,7 @@ public class JpaBulkExportProcessor implements IBulkExportProcessor { @SuppressWarnings("rawtypes") @Autowired - private IMdmLinkDao myMdmLinkDao; + protected IMdmLinkDao myMdmLinkDao; @Autowired private MdmExpansionCacheSvc myMdmExpansionCacheSvc; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java index 53bda22ed1dd..318126e119d8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java @@ -582,7 +582,7 @@ private Map>> translateForcedIdToPids( return retVal; } - RequestPartitionId replaceDefault(RequestPartitionId theRequestPartitionId) { + public RequestPartitionId replaceDefault(RequestPartitionId theRequestPartitionId) { if (myPartitionSettings.getDefaultPartitionId() != null) { if (!theRequestPartitionId.isAllPartitions() && theRequestPartitionId.hasDefaultPartitionId()) { List partitionIds = theRequestPartitionId.getPartitionIds().stream() @@ -712,7 +712,7 @@ public void addResolvedPidToForcedId( } @VisibleForTesting - void setPartitionSettingsForUnitTest(PartitionSettings thePartitionSettings) { + public void setPartitionSettingsForUnitTest(PartitionSettings thePartitionSettings) { myPartitionSettings = thePartitionSettings; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImpl.java index bc8930953e8e..478c60e2040f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImpl.java @@ -71,7 +71,7 @@ public class SynchronousSearchSvcImpl implements ISynchronousSearchSvc { private JpaStorageSettings myStorageSettings; @Autowired - private SearchBuilderFactory mySearchBuilderFactory; + protected SearchBuilderFactory mySearchBuilderFactory; @Autowired private DaoRegistry myDaoRegistry; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java index d9f1e5e2b5a3..af712a2e197b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java @@ -98,14 +98,13 @@ import jakarta.persistence.NonUniqueResultException; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.time.DateUtils; import org.apache.lucene.index.Term; -import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.IndexSearcher; import org.hibernate.CacheMode; import org.hibernate.search.engine.search.predicate.dsl.BooleanPredicateClausesStep; import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep; @@ -175,6 +174,7 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; +import java.util.function.Supplier; import java.util.stream.Collectors; import static ca.uhn.fhir.jpa.entity.TermConceptPropertyBinder.CONCEPT_PROPERTY_PREFIX_NAME; @@ -1135,77 +1135,90 @@ private void expandValueSetHandleIncludeOrExcludeUsingDatabase( } int chunkSize = chunkSizeOpt.get(); - SearchProperties searchProps = buildSearchScroll( + /* + * Turn the filter into one or more Hibernate Search queries. Ideally we want it + * to be handled by a single query, but Lucene/ES don't like it when we exceed + * 1024 different terms in a single query. So if we have that many terms (which + * can happen if a ValueSet has a lot of explicitly enumerated codes that it's + * including) we split this into multiple searches. The method below builds these + * searches lazily, returning a Supplier that creates and executes the search + * when it's actually time to. + */ + SearchProperties searchProps = buildSearchScrolls( theTermCodeSystemVersion, theExpansionFilter, theSystem, theIncludeOrExclude, chunkSize, includeOrExcludeVersion); - int accumulatedBatchesSoFar = 0; - try (SearchScroll scroll = searchProps.getSearchScroll()) { + for (var next : searchProps.getSearchScroll()) { + try (SearchScroll scroll = next.get()) { - ourLog.debug( - "Beginning batch expansion for {} with max results per batch: {}", - (theAdd ? "inclusion" : "exclusion"), - chunkSize); - for (SearchScrollResult chunk = scroll.next(); chunk.hasHits(); chunk = scroll.next()) { - int countForBatch = 0; - - List pids = chunk.hits().stream().map(t -> (Long) t.id()).collect(Collectors.toList()); - - List termConcepts = myTermConceptDao.fetchConceptsAndDesignationsByPid(pids); - - // If the include section had multiple codes, return the codes in the same order - termConcepts = sortTermConcepts(searchProps, termConcepts); - - // int firstResult = theQueryIndex * maxResultsPerBatch;// TODO GGG HS we lose the ability to check the - // index of the first result, so just best-guessing it here. - Optional expansionStepOpt = searchProps.getExpansionStepOpt(); - int delta = 0; - for (TermConcept concept : termConcepts) { - count++; - countForBatch++; - if (theAdd && expansionStepOpt.isPresent()) { - ValueSet.ConceptReferenceComponent theIncludeConcept = - getMatchedConceptIncludedInValueSet(theIncludeOrExclude, concept); - if (theIncludeConcept != null && isNotBlank(theIncludeConcept.getDisplay())) { - concept.setDisplay(theIncludeConcept.getDisplay()); + ourLog.debug( + "Beginning batch expansion for {} with max results per batch: {}", + (theAdd ? "inclusion" : "exclusion"), + chunkSize); + for (SearchScrollResult chunk = scroll.next(); + chunk.hasHits(); + chunk = scroll.next()) { + int countForBatch = 0; + + List pids = + chunk.hits().stream().map(t -> (Long) t.id()).collect(Collectors.toList()); + + List termConcepts = myTermConceptDao.fetchConceptsAndDesignationsByPid(pids); + + // If the include section had multiple codes, return the codes in the same order + termConcepts = sortTermConcepts(searchProps, termConcepts); + + // int firstResult = theQueryIndex * maxResultsPerBatch; + // TODO GGG HS we lose the ability to check the + // index of the first result, so just best-guessing it here. + int delta = 0; + for (TermConcept concept : termConcepts) { + count++; + countForBatch++; + if (theAdd && searchProps.hasIncludeOrExcludeCodes()) { + ValueSet.ConceptReferenceComponent theIncludeConcept = + getMatchedConceptIncludedInValueSet(theIncludeOrExclude, concept); + if (theIncludeConcept != null && isNotBlank(theIncludeConcept.getDisplay())) { + concept.setDisplay(theIncludeConcept.getDisplay()); + } + } + boolean added = addCodeIfNotAlreadyAdded( + theExpansionOptions, + theValueSetCodeAccumulator, + theAddedCodes, + concept, + theAdd, + includeOrExcludeVersion); + if (added) { + delta++; } } - boolean added = addCodeIfNotAlreadyAdded( - theExpansionOptions, - theValueSetCodeAccumulator, - theAddedCodes, - concept, - theAdd, - includeOrExcludeVersion); - if (added) { - delta++; - } + + ourLog.debug( + "Batch expansion scroll for {} with offset {} produced {} results in {}ms", + (theAdd ? "inclusion" : "exclusion"), + accumulatedBatchesSoFar, + chunk.hits().size(), + chunk.took().toMillis()); + + theValueSetCodeAccumulator.incrementOrDecrementTotalConcepts(theAdd, delta); + accumulatedBatchesSoFar += countForBatch; + + // keep session bounded + myEntityManager.flush(); + myEntityManager.clear(); } ourLog.debug( - "Batch expansion scroll for {} with offset {} produced {} results in {}ms", + "Expansion for {} produced {} results in {}ms", (theAdd ? "inclusion" : "exclusion"), - accumulatedBatchesSoFar, - chunk.hits().size(), - chunk.took().toMillis()); - - theValueSetCodeAccumulator.incrementOrDecrementTotalConcepts(theAdd, delta); - accumulatedBatchesSoFar += countForBatch; - - // keep session bounded - myEntityManager.flush(); - myEntityManager.clear(); + count, + fullOperationSw.getMillis()); } - - ourLog.debug( - "Expansion for {} produced {} results in {}ms", - (theAdd ? "inclusion" : "exclusion"), - count, - fullOperationSw.getMillis()); } } @@ -1243,7 +1256,7 @@ private Optional getScrollChunkSize( return maxResultsPerBatch > 0 ? Optional.of(maxResultsPerBatch) : Optional.empty(); } - private SearchProperties buildSearchScroll( + private SearchProperties buildSearchScrolls( TermCodeSystemVersion theTermCodeSystemVersion, ExpansionFilter theExpansionFilter, String theSystem, @@ -1255,54 +1268,68 @@ private SearchProperties buildSearchScroll( SearchPredicateFactory predicate = searchSession.scope(TermConcept.class).predicate(); - // Build the top-level expansion on filters. - PredicateFinalStep step = predicate.bool(b -> { - b.must(predicate.match().field("myCodeSystemVersionPid").matching(theTermCodeSystemVersion.getPid())); - - if (theExpansionFilter.hasCode()) { - b.must(predicate.match().field("myCode").matching(theExpansionFilter.getCode())); - } - - String codeSystemUrlAndVersion = buildCodeSystemUrlAndVersion(theSystem, theIncludeOrExcludeVersion); - for (ValueSet.ConceptSetFilterComponent nextFilter : theIncludeOrExclude.getFilter()) { - handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter); - } - for (ValueSet.ConceptSetFilterComponent nextFilter : theExpansionFilter.getFilters()) { - handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter); - } - }); - - SearchProperties returnProps = new SearchProperties(); - - List codes = theIncludeOrExclude.getConcept().stream() + List allCodes = theIncludeOrExclude.getConcept().stream() .filter(Objects::nonNull) .map(ValueSet.ConceptReferenceComponent::getCode) .filter(StringUtils::isNotBlank) .collect(Collectors.toList()); - returnProps.setIncludeOrExcludeCodes(codes); - - Optional expansionStepOpt = buildExpansionPredicate(codes, predicate); - final PredicateFinalStep finishedQuery = - expansionStepOpt.isPresent() ? predicate.bool().must(step).must(expansionStepOpt.get()) : step; - returnProps.setExpansionStepOpt(expansionStepOpt); + SearchProperties returnProps = new SearchProperties(); + returnProps.setIncludeOrExcludeCodes(allCodes); /* - * DM 2019-08-21 - Processing slows after any ValueSets with many codes explicitly identified. This might - * be due to the dark arts that is memory management. Will monitor but not do anything about this right now. + * Lucene/ES can't typically handle more than 1024 clauses per search, so if + * we have more than that number (e.g. because of a ValueSet that explicitly + * includes thousands of codes), we break this up into multiple searches. */ + List> partitionedCodes = ListUtils.partition(allCodes, IndexSearcher.getMaxClauseCount() - 10); + if (partitionedCodes.isEmpty()) { + partitionedCodes = List.of(List.of()); + } + + for (List nextCodePartition : partitionedCodes) { + Supplier> nextScroll = () -> { + // Build the top-level expansion on filters. + PredicateFinalStep step = predicate.bool(b -> { + b.must(predicate + .match() + .field("myCodeSystemVersionPid") + .matching(theTermCodeSystemVersion.getPid())); + + if (theExpansionFilter.hasCode()) { + b.must(predicate.match().field("myCode").matching(theExpansionFilter.getCode())); + } - // BooleanQuery.setMaxClauseCount(SearchBuilder.getMaximumPageSize()); - // TODO GGG HS looks like we can't set max clause count, but it can be set server side. - // BooleanQuery.setMaxClauseCount(10000); - // JM 22-02-15 - Hopefully increasing maxClauseCount should be not needed anymore + String codeSystemUrlAndVersion = + buildCodeSystemUrlAndVersion(theSystem, theIncludeOrExcludeVersion); + for (ValueSet.ConceptSetFilterComponent nextFilter : theIncludeOrExclude.getFilter()) { + handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter); + } + for (ValueSet.ConceptSetFilterComponent nextFilter : theExpansionFilter.getFilters()) { + handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter); + } + }); - SearchQuery termConceptsQuery = searchSession - .search(TermConcept.class) - .selectEntityReference() - .where(f -> finishedQuery) - .toQuery(); + // Add a selector on any explicitly enumerated codes in the VS component + final PredicateFinalStep finishedQuery; + if (nextCodePartition.isEmpty()) { + finishedQuery = step; + } else { + PredicateFinalStep expansionStep = buildExpansionPredicate(nextCodePartition, predicate); + finishedQuery = predicate.bool().must(step).must(expansionStep); + } + + SearchQuery termConceptsQuery = searchSession + .search(TermConcept.class) + .selectEntityReference() + .where(f -> finishedQuery) + .toQuery(); + + return termConceptsQuery.scroll(theScrollChunkSize); + }; + + returnProps.addSearchScroll(nextScroll); + } - returnProps.setSearchScroll(termConceptsQuery.scroll(theScrollChunkSize)); return returnProps; } @@ -1317,29 +1344,9 @@ private ValueSet.ConceptReferenceComponent getMatchedConceptIncludedInValueSet( /** * Helper method which builds a predicate for the expansion */ - private Optional buildExpansionPredicate( - List theCodes, SearchPredicateFactory thePredicate) { - if (CollectionUtils.isEmpty(theCodes)) { - return Optional.empty(); - } - - if (theCodes.size() < BooleanQuery.getMaxClauseCount()) { - return Optional.of(thePredicate.simpleQueryString().field("myCode").matching(String.join(" | ", theCodes))); - } - - // Number of codes is larger than maxClauseCount, so we split the query in several clauses - - // partition codes in lists of BooleanQuery.getMaxClauseCount() size - List> listOfLists = ListUtils.partition(theCodes, BooleanQuery.getMaxClauseCount()); - - PredicateFinalStep step = thePredicate.bool(b -> { - b.minimumShouldMatchNumber(1); - for (List codeList : listOfLists) { - b.should(p -> p.simpleQueryString().field("myCode").matching(String.join(" | ", codeList))); - } - }); - - return Optional.of(step); + private PredicateFinalStep buildExpansionPredicate(List theCodes, SearchPredicateFactory thePredicate) { + assert !theCodes.isEmpty(); + return thePredicate.simpleQueryString().field("myCode").matching(String.join(" | ", theCodes)); } private String buildCodeSystemUrlAndVersion(String theSystem, String theIncludeOrExcludeVersion) { @@ -3150,24 +3157,15 @@ public void execute(JobExecutionContext theContext) { * Properties returned from method buildSearchScroll */ private static final class SearchProperties { - private SearchScroll mySearchScroll; - private Optional myExpansionStepOpt; + private List>> mySearchScroll = new ArrayList<>(); private List myIncludeOrExcludeCodes; - public SearchScroll getSearchScroll() { + public List>> getSearchScroll() { return mySearchScroll; } - public void setSearchScroll(SearchScroll theSearchScroll) { - mySearchScroll = theSearchScroll; - } - - public Optional getExpansionStepOpt() { - return myExpansionStepOpt; - } - - public void setExpansionStepOpt(Optional theExpansionStepOpt) { - myExpansionStepOpt = theExpansionStepOpt; + public void addSearchScroll(Supplier> theSearchScrollSupplier) { + mySearchScroll.add(theSearchScrollSupplier); } public List getIncludeOrExcludeCodes() { @@ -3177,6 +3175,10 @@ public List getIncludeOrExcludeCodes() { public void setIncludeOrExcludeCodes(List theIncludeOrExcludeCodes) { myIncludeOrExcludeCodes = theIncludeOrExcludeCodes; } + + public boolean hasIncludeOrExcludeCodes() { + return !myIncludeOrExcludeCodes.isEmpty(); + } } static boolean isValueSetDisplayLanguageMatch(ValueSetExpansionOptions theExpansionOptions, String theStoredLang) { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessorTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessorTest.java index b9fb4603efed..ce8603ae23fa 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessorTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessorTest.java @@ -35,6 +35,7 @@ import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Patient; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; @@ -152,6 +153,12 @@ public JpaPid next() { @InjectMocks private JpaBulkExportProcessor myProcessor; + @BeforeEach + public void init() { + myProcessor.mySearchBuilderFactory = mySearchBuilderFactory; + myProcessor.myMdmLinkDao = myMdmLinkDao; + } + private ExportPIDIteratorParameters createExportParameters(BulkExportJobParameters.ExportStyle theExportStyle) { ExportPIDIteratorParameters parameters = new ExportPIDIteratorParameters(); parameters.setInstanceId("instanceId"); diff --git a/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml b/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml index 1f669de99fda..1657fc945d67 100644 --- a/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml +++ b/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-hfql/pom.xml b/hapi-fhir-jpaserver-hfql/pom.xml index 10d152bd8ed7..91246c043155 100644 --- a/hapi-fhir-jpaserver-hfql/pom.xml +++ b/hapi-fhir-jpaserver-hfql/pom.xml @@ -3,7 +3,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-ips/pom.xml b/hapi-fhir-jpaserver-ips/pom.xml index 0f8306789eee..c586c8842d33 100644 --- a/hapi-fhir-jpaserver-ips/pom.xml +++ b/hapi-fhir-jpaserver-ips/pom.xml @@ -3,7 +3,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-mdm/pom.xml b/hapi-fhir-jpaserver-mdm/pom.xml index ab38641ef63b..34b6e0d86d9d 100644 --- a/hapi-fhir-jpaserver-mdm/pom.xml +++ b/hapi-fhir-jpaserver-mdm/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-model/pom.xml b/hapi-fhir-jpaserver-model/pom.xml index c1ed4703b62c..9b3da9117eaa 100644 --- a/hapi-fhir-jpaserver-model/pom.xml +++ b/hapi-fhir-jpaserver-model/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -86,7 +86,7 @@ org.hibernate.search - hibernate-search-mapper-orm-orm6 + hibernate-search-mapper-orm org.hibernate.search diff --git a/hapi-fhir-jpaserver-searchparam/pom.xml b/hapi-fhir-jpaserver-searchparam/pom.xml index de4f14729f42..5df87e82fd7f 100755 --- a/hapi-fhir-jpaserver-searchparam/pom.xml +++ b/hapi-fhir-jpaserver-searchparam/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -125,7 +125,7 @@ org.hibernate.search - hibernate-search-mapper-orm-orm6 + hibernate-search-mapper-orm org.jscience diff --git a/hapi-fhir-jpaserver-subscription/pom.xml b/hapi-fhir-jpaserver-subscription/pom.xml index b53116fcafce..535df24d3e71 100644 --- a/hapi-fhir-jpaserver-subscription/pom.xml +++ b/hapi-fhir-jpaserver-subscription/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-dstu2/pom.xml b/hapi-fhir-jpaserver-test-dstu2/pom.xml index 154f9f2249af..7e4984179a72 100644 --- a/hapi-fhir-jpaserver-test-dstu2/pom.xml +++ b/hapi-fhir-jpaserver-test-dstu2/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImplTest.java b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImplTest.java index 456f42ee90ae..156c3dcb2f4e 100644 --- a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImplTest.java +++ b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SynchronousSearchSvcImplTest.java @@ -38,6 +38,7 @@ public class SynchronousSearchSvcImplTest extends BaseSearchSvc { @BeforeEach public void before() { mySynchronousSearchSvc.setContext(ourCtx); + mySynchronousSearchSvc.mySearchBuilderFactory = mySearchBuilderFactory; } @Test diff --git a/hapi-fhir-jpaserver-test-dstu3/pom.xml b/hapi-fhir-jpaserver-test-dstu3/pom.xml index 49e9f69971fa..24c196dc8eea 100644 --- a/hapi-fhir-jpaserver-test-dstu3/pom.xml +++ b/hapi-fhir-jpaserver-test-dstu3/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-r4/pom.xml b/hapi-fhir-jpaserver-test-r4/pom.xml index d860945ab267..854de84c4a21 100644 --- a/hapi-fhir-jpaserver-test-r4/pom.xml +++ b/hapi-fhir-jpaserver-test-r4/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookWithInterceptorR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookWithInterceptorR4Test.java index c8cbdb78936a..efdeab303269 100755 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookWithInterceptorR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookWithInterceptorR4Test.java @@ -21,7 +21,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; @@ -50,6 +54,7 @@ /** * Test the rest-hook subscriptions */ +@ExtendWith(MockitoExtension.class) public class RestHookWithInterceptorR4Test extends BaseSubscriptionsR4Test { private static final Logger ourLog = LoggerFactory.getLogger(RestHookWithInterceptorR4Test.class); @@ -61,6 +66,9 @@ public class RestHookWithInterceptorR4Test extends BaseSubscriptionsR4Test { private static boolean ourNextAddHeader; private static final FhirContext ourCtx = FhirContext.forR4Cached(); + @Mock(strictness = Mock.Strictness.STRICT_STUBS) + Logger loggerMock; + @Autowired StoppableSubscriptionDeliveringRestHookSubscriber myStoppableSubscriptionDeliveringRestHookSubscriber; @Autowired @@ -223,14 +231,13 @@ protected Observation sendObservation() { @Test public void testDebugLoggingInterceptor() throws Exception { List messages = new ArrayList<>(); - Logger loggerMock = mock(Logger.class); doAnswer(t -> { Object msg = t.getArguments()[0]; Object[] args = Arrays.copyOfRange(t.getArguments(), 1, t.getArguments().length); String formattedMessage = MessageFormatter.arrayFormat((String) msg, args).getMessage(); messages.add(formattedMessage); return null; - }).when(loggerMock).debug(any(), ArgumentMatchers.any()); + }).when(loggerMock).debug(any(), any(Object[].class)); SubscriptionDebugLogInterceptor interceptor = new SubscriptionDebugLogInterceptor(); myInterceptorRegistry.registerInterceptor(interceptor); diff --git a/hapi-fhir-jpaserver-test-r4b/pom.xml b/hapi-fhir-jpaserver-test-r4b/pom.xml index 6714e4e398bd..31b54f808d09 100644 --- a/hapi-fhir-jpaserver-test-r4b/pom.xml +++ b/hapi-fhir-jpaserver-test-r4b/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-r5/pom.xml b/hapi-fhir-jpaserver-test-r5/pom.xml index ae5782be485f..2fdaf7dafd15 100644 --- a/hapi-fhir-jpaserver-test-r5/pom.xml +++ b/hapi-fhir-jpaserver-test-r5/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-utilities/pom.xml b/hapi-fhir-jpaserver-test-utilities/pom.xml index d4578363f5b9..e3a0b3efc8cf 100644 --- a/hapi-fhir-jpaserver-test-utilities/pom.xml +++ b/hapi-fhir-jpaserver-test-utilities/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -85,6 +85,10 @@ org.apache.derby derby + + org.apache.derby + derbytools + org.springframework.boot spring-boot-test diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseValueSetHSearchExpansionR4Test.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseValueSetHSearchExpansionR4Test.java index 012d267af0cf..9b372ee49c46 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseValueSetHSearchExpansionR4Test.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseValueSetHSearchExpansionR4Test.java @@ -52,12 +52,8 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import org.apache.commons.collections4.ListUtils; import org.apache.lucene.search.BooleanQuery; -import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep; -import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory; -import org.hibernate.search.engine.search.query.SearchQuery; -import org.hibernate.search.mapper.orm.Search; +import org.apache.lucene.search.IndexSearcher; import org.hibernate.search.mapper.orm.common.EntityReference; -import org.hibernate.search.mapper.orm.session.SearchSession; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.ValueSet; @@ -72,7 +68,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.util.AopTestUtils; -import org.springframework.test.util.ReflectionTestUtils; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Transactional; @@ -80,7 +75,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -1944,7 +1938,7 @@ void generateLongSearchedCodesList() { @Test public void testShouldNotFindAny() { - List hits = search(allCodesNotIncludingSearched); + List hits = search(allCodesNotIncludingSearched); assertNotNull(hits); assertTrue(hits.isEmpty()); } @@ -1952,12 +1946,12 @@ public void testShouldNotFindAny() { @Test public void testHitsInFirstSublist() { - int insertIndex = BooleanQuery.getMaxClauseCount() / 2; + int insertIndex = IndexSearcher.getMaxClauseCount() / 2; // insert existing codes into list of codes searched allCodesNotIncludingSearched.addAll(insertIndex, existingCodes); - List hits = search(allCodesNotIncludingSearched); + List hits = search(allCodesNotIncludingSearched); assertEquals(existingCodes.size(), hits.size()); } @@ -1967,7 +1961,7 @@ public void testHitsInLastSublist() { // insert existing codes into list of codes searched allCodesNotIncludingSearched.addAll(allCodesNotIncludingSearched.size(), existingCodes); - List hits = search(allCodesNotIncludingSearched); + List hits = search(allCodesNotIncludingSearched); assertEquals(existingCodes.size(), hits.size()); } @@ -1986,42 +1980,20 @@ public void testHitsInBothSublists() { // insert last partition of existing codes into last sublist of searched codes allCodesNotIncludingSearched.addAll(allCodesNotIncludingSearched.size(), partitionedExistingCodes.get(1)); - List hits = search(allCodesNotIncludingSearched); + List hits = search(allCodesNotIncludingSearched); assertEquals(existingCodes.size(), hits.size()); } - private List search(List theSearchedCodes) { - return runInTransaction(() -> { - TermCodeSystemVersion termCsVersion = myTermCodeSystemVersionDao.findCurrentVersionForCodeSystemResourcePid(termCsId); - Long termCsvPid = termCsVersion.getPid(); - - SearchSession searchSession = Search.session(myEntityManager); - SearchPredicateFactory predicate = searchSession.scope(TermConcept.class).predicate(); - - Optional lastStepOpt = ReflectionTestUtils.invokeMethod( - new TermReadSvcImpl(), "buildExpansionPredicate", theSearchedCodes, predicate); - - assertNotNull(lastStepOpt); - assertTrue(lastStepOpt.isPresent()); - - PredicateFinalStep step = predicate.bool(b -> { - b.must(predicate.match().field("myCodeSystemVersionPid").matching(termCsvPid)); - b.must(lastStepOpt.get()); - }); - - int maxResultsPerBatch = 800; - - SearchQuery termConceptsQuery = searchSession - .search(TermConcept.class) - .selectEntityReference() - .where(f -> step) - .toQuery(); - - ourLog.trace("About to query: {}", termConceptsQuery.queryString()); - - return termConceptsQuery.fetchHits(0, maxResultsPerBatch); - }); - + private List search(List theSearchedCodes) { + // Include + ValueSet vs = new ValueSet(); + ValueSet.ConceptSetComponent include = vs.getCompose().addInclude(); + include.setSystem(LOINC_URI); + for (var next : theSearchedCodes) { + include.addConcept().setCode(next); + } + ValueSet outcome = myTermSvc.expandValueSet(null, vs); + return toCodesContains(outcome.getExpansion().getContains()); } } diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/dao/index/ResourceVersionSvcTest.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/cache/ResourceVersionSvcTest.java similarity index 96% rename from hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/dao/index/ResourceVersionSvcTest.java rename to hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/cache/ResourceVersionSvcTest.java index 6d14d7802914..322f7f75fb48 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/dao/index/ResourceVersionSvcTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/cache/ResourceVersionSvcTest.java @@ -1,4 +1,4 @@ -package ca.uhn.fhir.jpa.dao.index; +package ca.uhn.fhir.jpa.cache; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; @@ -6,6 +6,7 @@ import ca.uhn.fhir.jpa.cache.ResourcePersistentIdMap; import ca.uhn.fhir.jpa.cache.ResourceVersionSvcDaoImpl; import ca.uhn.fhir.jpa.dao.data.IResourceTableDao; +import ca.uhn.fhir.jpa.dao.index.IdHelperService; import ca.uhn.fhir.jpa.model.config.PartitionSettings; import ca.uhn.fhir.jpa.model.dao.JpaPid; import ca.uhn.fhir.jpa.model.entity.ForcedId; @@ -14,6 +15,7 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import org.hl7.fhir.instance.model.api.IIdType; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -52,6 +54,11 @@ public class ResourceVersionSvcTest { @InjectMocks private ResourceVersionSvcDaoImpl myResourceVersionSvc; + @BeforeEach + public void before() { + myResourceVersionSvc.myIdHelperService = myIdHelperService; + } + /** * Gets a ResourceTable record for getResourceVersionsForPid * Order matters! diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml index 8a739d50f7b4..5113e3c06266 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml +++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-server-cds-hooks/pom.xml b/hapi-fhir-server-cds-hooks/pom.xml index 956b726be7ec..ed320ecad095 100644 --- a/hapi-fhir-server-cds-hooks/pom.xml +++ b/hapi-fhir-server-cds-hooks/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsHooksContextBooterTest.java b/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsHooksContextBooterTest.java index 9dd21d8851d3..50ec81a27090 100644 --- a/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsHooksContextBooterTest.java +++ b/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsHooksContextBooterTest.java @@ -29,7 +29,7 @@ void validateJsonReturnsNullWhenInputIsEmptyString() { void validateJsonThrowsExceptionWhenInputIsInvalid() { // setup final String expected = "HAPI-2378: Invalid JSON: Unrecognized token 'abc': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n" + - " at [Source: (String)\"abc\"; line: 1, column: 4]"; + " at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 4]"; // execute final UnprocessableEntityException actual = assertThrows(UnprocessableEntityException.class, () -> myFixture.validateJson("abc")); // validate diff --git a/hapi-fhir-server-mdm/pom.xml b/hapi-fhir-server-mdm/pom.xml index bd8ff1b402d7..43b3d4db3ce7 100644 --- a/hapi-fhir-server-mdm/pom.xml +++ b/hapi-fhir-server-mdm/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-server-openapi/pom.xml b/hapi-fhir-server-openapi/pom.xml index 498814b7f35b..4c4ea01bd632 100644 --- a/hapi-fhir-server-openapi/pom.xml +++ b/hapi-fhir-server-openapi/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-server/pom.xml b/hapi-fhir-server/pom.xml index 78ba5b39626d..ef697cd2752a 100644 --- a/hapi-fhir-server/pom.xml +++ b/hapi-fhir-server/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml index bf1912000fcc..52cdaf3c29ba 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml @@ -7,7 +7,7 @@ hapi-fhir-serviceloaders ca.uhn.hapi.fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml index c86a69c94393..216873cd23c7 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml @@ -7,7 +7,7 @@ hapi-fhir-serviceloaders ca.uhn.hapi.fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml @@ -21,7 +21,7 @@ ca.uhn.hapi.fhir hapi-fhir-caching-api - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml index 0fbda588245d..a5a19274d2d5 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml @@ -7,7 +7,7 @@ hapi-fhir-serviceloaders ca.uhn.hapi.fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml index 95019e79c1e8..2c7dda6e262d 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml @@ -7,7 +7,7 @@ hapi-fhir ca.uhn.hapi.fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../../pom.xml diff --git a/hapi-fhir-serviceloaders/pom.xml b/hapi-fhir-serviceloaders/pom.xml index ae41c2b4bd43..4b4743e797cc 100644 --- a/hapi-fhir-serviceloaders/pom.xml +++ b/hapi-fhir-serviceloaders/pom.xml @@ -5,7 +5,7 @@ hapi-deployable-pom ca.uhn.hapi.fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml index 14106bc863e6..280244179520 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml index 0d523738ef7b..ce85e8237d49 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir-spring-boot-samples - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT hapi-fhir-spring-boot-sample-client-apache diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml index 038f5a09e071..94826df1f1d8 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir-spring-boot-samples - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml index b4c4ffcd5116..846c376ea2f1 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir-spring-boot-samples - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml index 192ba567fbb4..9f1a81f9ba5c 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir-spring-boot - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml index aada5bf3eacd..c1defd308e86 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-spring-boot/pom.xml b/hapi-fhir-spring-boot/pom.xml index 26ac8a2ea5d8..ef51abf6298a 100644 --- a/hapi-fhir-spring-boot/pom.xml +++ b/hapi-fhir-spring-boot/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-sql-migrate/pom.xml b/hapi-fhir-sql-migrate/pom.xml index 55f466fd9816..bb490eedb596 100644 --- a/hapi-fhir-sql-migrate/pom.xml +++ b/hapi-fhir-sql-migrate/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java index b5a1a3592f04..285ad1929c19 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java @@ -19,6 +19,7 @@ */ package ca.uhn.fhir.jpa.migrate.taskdef; +import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.JdbcUtils; import org.intellij.lang.annotations.Language; import org.slf4j.Logger; @@ -56,6 +57,10 @@ public void doExecute() throws SQLException { logInfo(ourLog, "Table {} has the following indexes: {}", getTableName(), indexNames); for (String next : foreignKeys) { + if (getDriverType() == DriverTypeEnum.DERBY_EMBEDDED && next.contains("-")) { + // Derby creates special internal indexes with GUID names that can't be deleted + continue; + } List sql = DropForeignKeyTask.generateSql(getTableName(), next, getDriverType()); for (@Language("SQL") String nextSql : sql) { executeSql(getTableName(), nextSql); @@ -69,6 +74,10 @@ public void doExecute() throws SQLException { .setDriverType(getDriverType()) .setDryRun(isDryRun()); for (String nextIndex : indexNames) { + if (getDriverType() == DriverTypeEnum.DERBY_EMBEDDED && nextIndex.contains("-")) { + // Derby creates special internal indexes with GUID names that can't be deleted + continue; + } theIndexTask.setIndexName(nextIndex).execute(); } diff --git a/hapi-fhir-storage-batch2-jobs/pom.xml b/hapi-fhir-storage-batch2-jobs/pom.xml index ebd2c7d22239..9f887a0055eb 100644 --- a/hapi-fhir-storage-batch2-jobs/pom.xml +++ b/hapi-fhir-storage-batch2-jobs/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java index 3d8d0a608ea8..6f43cc67967f 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc; import ca.uhn.fhir.util.BinaryUtil; import ca.uhn.fhir.util.FhirTerser; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import jakarta.annotation.Nonnull; @@ -456,4 +457,9 @@ private void addMetadataExtensionsToBinary( protected OutputStreamWriter getStreamWriter(ByteArrayOutputStream theOutputStream) { return new OutputStreamWriter(theOutputStream, Constants.CHARSET_UTF8); } + + @VisibleForTesting + public void setIdHelperServiceForUnitTest(IIdHelperService theIdHelperService) { + myIdHelperService = theIdHelperService; + } } diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java index bc8c29ff1cab..e2cce9c5f31c 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java @@ -48,6 +48,7 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import jakarta.annotation.Nonnull; @@ -287,4 +288,9 @@ private IParser getParser(BulkExportJobParameters theParameters) { // see WriteBinaryStep as well return myFhirContext.newJsonParser().setPrettyPrint(false); } + + @VisibleForTesting + public void setIdHelperServiceForUnitTest(IIdHelperService theIdHelperService) { + myIdHelperService = theIdHelperService; + } } diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java index 221902fe7b79..16ec8987a1de 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.jpa.bulk.export.model.ExportPIDIteratorParameters; import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import com.google.common.annotations.VisibleForTesting; import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -159,4 +160,9 @@ private void submitWorkChunk( theDataSink.accept(idList); } + + @VisibleForTesting + public void setBulkExportProcessorForUnitTest(IBulkExportProcessor theBulkExportProcessor) { + myBulkExportProcessor = theBulkExportProcessor; + } } diff --git a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStepTest.java b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStepTest.java index c8fa800616dd..576da3269aa5 100644 --- a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStepTest.java +++ b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStepTest.java @@ -123,6 +123,7 @@ protected OutputStreamWriter getStreamWriter(ByteArrayOutputStream theOutputStre @BeforeEach public void init() { ourLog.addAppender(myAppender); + myFinalStep.setIdHelperServiceForUnitTest(myIdHelperService); } @AfterEach diff --git a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStepTest.java b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStepTest.java index 194a694d934f..5ec874649fe3 100644 --- a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStepTest.java +++ b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStepTest.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.Patient; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -82,6 +83,11 @@ public class ExpandResourcesStepTest { @InjectMocks private ExpandResourcesStep mySecondStep; + @BeforeEach + public void init() { + mySecondStep.setIdHelperServiceForUnitTest(myIdHelperService); + } + private BulkExportJobParameters createParameters(boolean thePartitioned) { BulkExportJobParameters parameters = new BulkExportJobParameters(); parameters.setResourceTypes(Arrays.asList("Patient", "Observation")); diff --git a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStepTest.java b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStepTest.java index fdf4bc2f69b7..da80c5bea695 100644 --- a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStepTest.java +++ b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStepTest.java @@ -65,6 +65,7 @@ public class FetchResourceIdsStepTest { @BeforeEach public void init() { ourLog.addAppender(myAppender); + myFirstStep.setBulkExportProcessorForUnitTest(myBulkExportProcessor); } @AfterEach diff --git a/hapi-fhir-storage-batch2-test-utilities/pom.xml b/hapi-fhir-storage-batch2-test-utilities/pom.xml index 3e019dae205c..e619bfd89cf1 100644 --- a/hapi-fhir-storage-batch2-test-utilities/pom.xml +++ b/hapi-fhir-storage-batch2-test-utilities/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-batch2/pom.xml b/hapi-fhir-storage-batch2/pom.xml index 2ba9ea66ec44..43d24771f7bd 100644 --- a/hapi-fhir-storage-batch2/pom.xml +++ b/hapi-fhir-storage-batch2/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-cr/pom.xml b/hapi-fhir-storage-cr/pom.xml index d5935f26b014..9668284c6138 100644 --- a/hapi-fhir-storage-cr/pom.xml +++ b/hapi-fhir-storage-cr/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/ILibraryEvaluationServiceFactory.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/ILibraryEvaluationServiceFactory.java index 5ade2781cdba..aef5d796ad4e 100644 --- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/ILibraryEvaluationServiceFactory.java +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/ILibraryEvaluationServiceFactory.java @@ -1,3 +1,22 @@ +/*- + * #%L + * HAPI FHIR - Clinical Reasoning + * %% + * Copyright (C) 2014 - 2024 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ package ca.uhn.fhir.cr.r4; import ca.uhn.fhir.rest.api.server.RequestDetails; diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/cpg/LibraryEvaluationOperationProvider.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/cpg/LibraryEvaluationOperationProvider.java index d972193ca4e5..474c0d3ff747 100644 --- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/cpg/LibraryEvaluationOperationProvider.java +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/cpg/LibraryEvaluationOperationProvider.java @@ -1,3 +1,22 @@ +/*- + * #%L + * HAPI FHIR - Clinical Reasoning + * %% + * Copyright (C) 2014 - 2024 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ package ca.uhn.fhir.cr.r4.cpg; import ca.uhn.fhir.cr.r4.ILibraryEvaluationServiceFactory; diff --git a/hapi-fhir-storage-mdm/pom.xml b/hapi-fhir-storage-mdm/pom.xml index aec6b2eae06a..3532dbbd9557 100644 --- a/hapi-fhir-storage-mdm/pom.xml +++ b/hapi-fhir-storage-mdm/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-test-utilities/pom.xml b/hapi-fhir-storage-test-utilities/pom.xml index dd47a7ae2266..194eb269d0f0 100644 --- a/hapi-fhir-storage-test-utilities/pom.xml +++ b/hapi-fhir-storage-test-utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage/pom.xml b/hapi-fhir-storage/pom.xml index 293ac71f4346..5d61d558ebe8 100644 --- a/hapi-fhir-storage/pom.xml +++ b/hapi-fhir-storage/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -85,7 +85,7 @@ org.hibernate.search - hibernate-search-mapper-orm-orm6 + hibernate-search-mapper-orm org.hibernate.search @@ -166,12 +166,6 @@ ${project.version} test - - org.mockito - mockito-inline - ${mockito_version} - test - diff --git a/hapi-fhir-structures-dstu2.1/pom.xml b/hapi-fhir-structures-dstu2.1/pom.xml index c6512bf925d5..9691c8c647b2 100644 --- a/hapi-fhir-structures-dstu2.1/pom.xml +++ b/hapi-fhir-structures-dstu2.1/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-dstu2/pom.xml b/hapi-fhir-structures-dstu2/pom.xml index 3e5c3b2b8873..5a9c7289893e 100644 --- a/hapi-fhir-structures-dstu2/pom.xml +++ b/hapi-fhir-structures-dstu2/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-dstu3/pom.xml b/hapi-fhir-structures-dstu3/pom.xml index 2ff38739eafe..e82ea20c474a 100644 --- a/hapi-fhir-structures-dstu3/pom.xml +++ b/hapi-fhir-structures-dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-hl7org-dstu2/pom.xml b/hapi-fhir-structures-hl7org-dstu2/pom.xml index 2a7f55a3af48..3862f6bfc918 100644 --- a/hapi-fhir-structures-hl7org-dstu2/pom.xml +++ b/hapi-fhir-structures-hl7org-dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-r4/pom.xml b/hapi-fhir-structures-r4/pom.xml index ade996453149..ad81935e5481 100644 --- a/hapi-fhir-structures-r4/pom.xml +++ b/hapi-fhir-structures-r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-r4b/pom.xml b/hapi-fhir-structures-r4b/pom.xml index 9f615cbb6035..f62d907c6f2c 100644 --- a/hapi-fhir-structures-r4b/pom.xml +++ b/hapi-fhir-structures-r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-r5/pom.xml b/hapi-fhir-structures-r5/pom.xml index 1cab6012d0bc..5ac839d147ef 100644 --- a/hapi-fhir-structures-r5/pom.xml +++ b/hapi-fhir-structures-r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-test-utilities/pom.xml b/hapi-fhir-test-utilities/pom.xml index 8e2dc3ab9359..0187b643a2f2 100644 --- a/hapi-fhir-test-utilities/pom.xml +++ b/hapi-fhir-test-utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -88,7 +88,7 @@ org.hibernate.search - hibernate-search-mapper-orm-orm6 + hibernate-search-mapper-orm org.hibernate.validator diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/server/MockServletUtil.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/server/MockServletUtil.java index 87545a31ab88..0474e274fe65 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/server/MockServletUtil.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/server/MockServletUtil.java @@ -20,9 +20,11 @@ package ca.uhn.fhir.test.utilities.server; import jakarta.servlet.ServletConfig; +import org.mockito.quality.Strictness; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.withSettings; public class MockServletUtil { @@ -34,7 +36,7 @@ private MockServletUtil() { } public static ServletConfig createServletConfig() { - ServletConfig sc = mock(ServletConfig.class); + ServletConfig sc = mock(ServletConfig.class, withSettings().strictness(Strictness.LENIENT)); when(sc.getServletContext()).thenReturn(null); return sc; } diff --git a/hapi-fhir-testpage-overlay/pom.xml b/hapi-fhir-testpage-overlay/pom.xml index 1661836f639e..3e679c1c08ec 100644 --- a/hapi-fhir-testpage-overlay/pom.xml +++ b/hapi-fhir-testpage-overlay/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-validation-resources-dstu2.1/pom.xml b/hapi-fhir-validation-resources-dstu2.1/pom.xml index e486d68925f6..1d35f40452e1 100644 --- a/hapi-fhir-validation-resources-dstu2.1/pom.xml +++ b/hapi-fhir-validation-resources-dstu2.1/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-dstu2/pom.xml b/hapi-fhir-validation-resources-dstu2/pom.xml index 5e6fbac74c93..f66691a5f81e 100644 --- a/hapi-fhir-validation-resources-dstu2/pom.xml +++ b/hapi-fhir-validation-resources-dstu2/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-dstu3/pom.xml b/hapi-fhir-validation-resources-dstu3/pom.xml index a65b0fb96908..5148f0a3c20e 100644 --- a/hapi-fhir-validation-resources-dstu3/pom.xml +++ b/hapi-fhir-validation-resources-dstu3/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-r4/pom.xml b/hapi-fhir-validation-resources-r4/pom.xml index d5e0ba03a102..6327b9b84579 100644 --- a/hapi-fhir-validation-resources-r4/pom.xml +++ b/hapi-fhir-validation-resources-r4/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-r4b/pom.xml b/hapi-fhir-validation-resources-r4b/pom.xml index 04ad6e00b61a..9965204da32d 100644 --- a/hapi-fhir-validation-resources-r4b/pom.xml +++ b/hapi-fhir-validation-resources-r4b/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-r5/pom.xml b/hapi-fhir-validation-resources-r5/pom.xml index 02908b8c4624..8dbce2490ef7 100644 --- a/hapi-fhir-validation-resources-r5/pom.xml +++ b/hapi-fhir-validation-resources-r5/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation/pom.xml b/hapi-fhir-validation/pom.xml index f8f78712dc54..4c471109d241 100644 --- a/hapi-fhir-validation/pom.xml +++ b/hapi-fhir-validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/BaseValidationTestWithInlineMocks.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/BaseValidationTestWithInlineMocks.java new file mode 100644 index 000000000000..62f89000a56a --- /dev/null +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/BaseValidationTestWithInlineMocks.java @@ -0,0 +1,21 @@ +package ca.uhn.fhir.fhirpath; + +import ca.uhn.fhir.test.BaseTest; +import org.junit.jupiter.api.AfterEach; +import org.mockito.Mockito; + +public abstract class BaseValidationTestWithInlineMocks extends BaseTest { + + /** + * Avoid memory leaks due to inline mocks. See https://github.com/mockito/mockito/pull/1619 + * Note that we don't declare the test classes in this + * module with @ExtendWith(MockitoExtension.class) because + * Mockito 5 seems to not like mixing inline mocks with + * extension managed ones. + */ + @AfterEach + public void clearMocks() { + Mockito.framework().clearInlineMocks(); + } + +} diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/FhirPathTest.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/FhirPathTest.java index c6bdc674c06c..7593297ed19a 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/FhirPathTest.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/fhirpath/FhirPathTest.java @@ -4,6 +4,7 @@ import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.TestUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.HumanName; @@ -11,7 +12,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import jakarta.annotation.Nonnull; import java.util.Arrays; import java.util.List; import java.util.stream.Stream; @@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.endsWith; import static org.junit.jupiter.api.Assertions.assertEquals; -public class FhirPathTest { +public class FhirPathTest extends BaseValidationTestWithInlineMocks { @ParameterizedTest @MethodSource("provideContexts") diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorDstu3Test.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorDstu3Test.java index ae9037c783a3..f3abc6124875 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorDstu3Test.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.primitive.IdDt; @@ -17,13 +18,11 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor; import ca.uhn.fhir.test.utilities.HttpClientExtension; -import ca.uhn.fhir.test.utilities.JettyUtil; import ca.uhn.fhir.test.utilities.server.RestfulServerExtension; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.IValidationContext; import ca.uhn.fhir.validation.IValidatorModule; import ca.uhn.fhir.validation.ResultSeverityEnum; -import ca.uhn.hapi.converters.server.VersionedApiConverterInterceptor; import org.apache.commons.io.IOUtils; import org.apache.http.HttpResponse; import org.apache.http.client.methods.CloseableHttpResponse; @@ -32,12 +31,6 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.ee10.servlet.ServletHandler; -import org.eclipse.jetty.ee10.servlet.ServletHolder; import org.hamcrest.Matchers; import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator; import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender; @@ -45,7 +38,6 @@ import org.hl7.fhir.dstu3.model.Patient; import org.hl7.fhir.instance.model.api.IBaseResource; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -53,13 +45,12 @@ import java.util.ArrayList; import java.util.List; -import java.util.concurrent.TimeUnit; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; -public class RequestValidatingInterceptorDstu3Test { +public class RequestValidatingInterceptorDstu3Test extends BaseValidationTestWithInlineMocks { private static final FhirContext ourCtx = FhirContext.forDstu3Cached(); private static boolean ourLastRequestWasSearch; diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorR4Test.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorR4Test.java index 1de8f575de43..e6a9f02568db 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorR4Test.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorR4Test.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.annotation.Create; @@ -59,7 +60,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; -public class RequestValidatingInterceptorR4Test { +public class RequestValidatingInterceptorR4Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RequestValidatingInterceptorR4Test.class); @RegisterExtension static HttpClientExtension ourClient = new HttpClientExtension(); diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorDstu3Test.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorDstu3Test.java index f3f92c0f20d6..d91dc017ef6f 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorDstu3Test.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.annotation.Delete; import ca.uhn.fhir.rest.annotation.IdParam; @@ -41,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; -public class ResponseValidatingInterceptorDstu3Test { +public class ResponseValidatingInterceptorDstu3Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResponseValidatingInterceptorDstu3Test.class); public static IBaseResource myReturnResource; private static final FhirContext ourCtx = FhirContext.forDstu3Cached(); diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorR4Test.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorR4Test.java index 6b7e0f2b6e9d..f2b44b5aff76 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorR4Test.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ResponseValidatingInterceptorR4Test.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; @@ -43,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; -public class ResponseValidatingInterceptorR4Test { +public class ResponseValidatingInterceptorR4Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResponseValidatingInterceptorR4Test.class); @RegisterExtension static HttpClientExtension ourClient = new HttpClientExtension(); diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java index 5cb496f79502..57e81f81e8ba 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.jpa.model.util.JpaConstants; import ca.uhn.fhir.model.api.Include; import ca.uhn.fhir.model.api.annotation.Description; @@ -70,7 +71,6 @@ import org.hl7.fhir.r4.model.Encounter; import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.hl7.fhir.r4.model.Extension; -import org.hl7.fhir.r4.model.Group; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.OperationDefinition; @@ -85,6 +85,8 @@ import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; +import org.mockito.quality.Strictness; + import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -112,8 +114,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.withSettings; -public class ServerCapabilityStatementProviderR4Test { +public class ServerCapabilityStatementProviderR4Test extends BaseValidationTestWithInlineMocks { public static final String PATIENT_SUB = "PatientSub"; public static final String PATIENT_SUB_SUB = "PatientSubSub"; @@ -143,7 +146,7 @@ public void before() { } private HttpServletRequest createHttpServletRequest() { - HttpServletRequest req = mock(HttpServletRequest.class); + HttpServletRequest req = mock(HttpServletRequest.class, withSettings().strictness(Strictness.LENIENT)); when(req.getRequestURI()).thenReturn("/FhirStorm/fhir/Patient/_search"); when(req.getServletPath()).thenReturn("/fhir"); when(req.getRequestURL()).thenReturn(new StringBuffer().append("http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Patient/_search")); diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyDisplayPopulationInterceptorTest.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyDisplayPopulationInterceptorTest.java index 99f5a4c00e6c..bf655864b777 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyDisplayPopulationInterceptorTest.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyDisplayPopulationInterceptorTest.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValidationSupportContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.test.utilities.server.HashMapResourceProviderExtension; import ca.uhn.fhir.test.utilities.server.RestfulServerExtension; @@ -18,7 +19,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class ResponseTerminologyDisplayPopulationInterceptorTest { +public class ResponseTerminologyDisplayPopulationInterceptorTest extends BaseValidationTestWithInlineMocks { private final FhirContext myCtx = FhirContext.forR4Cached(); @Order(0) diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java index 4eede51ccf1f..d85cf5e4ee99 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java @@ -2,6 +2,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.api.AddProfileTagEnum; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.interceptor.api.HookParams; import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster; @@ -109,7 +110,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -public class AuthorizationInterceptorR4Test { +public class AuthorizationInterceptorR4Test extends BaseValidationTestWithInlineMocks { private static final String ERR403 = "{\"resourceType\":\"OperationOutcome\",\"issue\":[{\"severity\":\"error\",\"code\":\"processing\",\"diagnostics\":\"" + Msg.code(334) + "Access denied by default policy (no applicable rules)\"}]}"; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(AuthorizationInterceptorR4Test.class); diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/HapiFhirCodeSystemGeneratorTest.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/HapiFhirCodeSystemGeneratorTest.java index 984458830dc1..116f2f24761d 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/HapiFhirCodeSystemGeneratorTest.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/HapiFhirCodeSystemGeneratorTest.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.model.api.StorageResponseCodeEnum; import ca.uhn.fhir.parser.IParser; import org.apache.commons.io.IOUtils; @@ -19,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.fail; -public class HapiFhirCodeSystemGeneratorTest { +public class HapiFhirCodeSystemGeneratorTest extends BaseValidationTestWithInlineMocks { public static final String HAPI_FHIR_STORAGE_RESPONSE_CODE_JSON = "HapiFhirStorageResponseCode.json"; public static final FhirContext ourCtx = FhirContext.forR5Cached(); diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/ParserWithValidationDstu3Test.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/ParserWithValidationDstu3Test.java index a8eb545b6f79..7bbfd28d41b4 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/ParserWithValidationDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/ParserWithValidationDstu3Test.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.util.TestUtil; import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; @@ -18,7 +19,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class ParserWithValidationDstu3Test { +public class ParserWithValidationDstu3Test extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(ParserWithValidationDstu3Test.class); private static FhirContext ourCtx = FhirContext.forDstu3(); diff --git a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/SchemaBaseValidatorTest.java b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/SchemaBaseValidatorTest.java index 7e8ac7e0ec8c..43021a8d8bf5 100644 --- a/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/SchemaBaseValidatorTest.java +++ b/hapi-fhir-validation/src/test/java/ca/uhn/fhir/validation/SchemaBaseValidatorTest.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import org.junit.jupiter.api.Test; @@ -11,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; -public class SchemaBaseValidatorTest { +public class SchemaBaseValidatorTest extends BaseValidationTestWithInlineMocks { @Test public void testLoadXmlSuccess() { diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CachingValidationSupportTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CachingValidationSupportTest.java index 5aa425171100..5e11401b7c9f 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CachingValidationSupportTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CachingValidationSupportTest.java @@ -2,7 +2,10 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import com.google.common.collect.Lists; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.StructureDefinition; import org.junit.jupiter.api.extension.ExtendWith; @@ -12,8 +15,6 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import jakarta.annotation.Nonnull; -import jakarta.annotation.Nullable; import java.util.Collections; import java.util.List; diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CommonCodeSystemsTerminologyServiceTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CommonCodeSystemsTerminologyServiceTest.java index cb8c812949c9..21a2799eb162 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CommonCodeSystemsTerminologyServiceTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/CommonCodeSystemsTerminologyServiceTest.java @@ -5,6 +5,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.context.support.LookupCodeRequest; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.CodeSystem; @@ -19,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -public class CommonCodeSystemsTerminologyServiceTest { +public class CommonCodeSystemsTerminologyServiceTest extends BaseValidationTestWithInlineMocks { private CommonCodeSystemsTerminologyService mySvc; private FhirContext myCtx; diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupportTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupportTest.java index 1a8f683a325f..77d309503b67 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupportTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupportTest.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.context.support.ValueSetExpansionOptions; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.CodeSystem; @@ -31,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class InMemoryTerminologyServerValidationSupportTest { +public class InMemoryTerminologyServerValidationSupportTest extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(InMemoryTerminologyServerValidationSupportTest.class); private InMemoryTerminologyServerValidationSupport mySvc; diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/PrePopulatedValidationSupportTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/PrePopulatedValidationSupportTest.java index 6297ae753ebc..d57910275c3d 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/PrePopulatedValidationSupportTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/PrePopulatedValidationSupportTest.java @@ -1,6 +1,7 @@ package org.hl7.fhir.common.hapi.validation.support; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.StructureDefinition; import org.hl7.fhir.r4.model.ValueSet; @@ -11,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertSame; -public class PrePopulatedValidationSupportTest { +public class PrePopulatedValidationSupportTest extends BaseValidationTestWithInlineMocks { private final PrePopulatedValidationSupport mySvc = new PrePopulatedValidationSupport(FhirContext.forR4Cached()); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChainTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChainTest.java index 59fd4ae9a846..9eb696615f0e 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChainTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChainTest.java @@ -5,16 +5,17 @@ import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; -import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class ValidationSupportChainTest { +public class ValidationSupportChainTest extends BaseValidationTestWithInlineMocks { @Test diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapperTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapperTest.java index e85932809f68..6dbd718548ee 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapperTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapperTest.java @@ -4,10 +4,12 @@ import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValidationSupportContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.HapiLocalizer; import ca.uhn.hapi.converters.canonical.VersionCanonicalizer; import org.hl7.fhir.r5.model.Resource; import org.junit.jupiter.api.Test; +import org.mockito.quality.Strictness; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -15,8 +17,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.withSettings; -public class VersionSpecificWorkerContextWrapperTest { +public class VersionSpecificWorkerContextWrapperTest extends BaseValidationTestWithInlineMocks { final byte[] EXPECTED_BINARY_CONTENT_1 = "dummyBinaryContent1".getBytes(); final byte[] EXPECTED_BINARY_CONTENT_2 = "dummyBinaryContent2".getBytes(); @@ -88,7 +91,7 @@ private static ValidationSupportContext mockValidationSupportContext(IValidation private static IValidationSupport mockValidationSupport() { IValidationSupport mockValidationSupport; mockValidationSupport = mock(IValidationSupport.class); - FhirContext mockFhirContext = mock(FhirContext.class); + FhirContext mockFhirContext = mock(FhirContext.class, withSettings().strictness(Strictness.LENIENT)); when(mockFhirContext.getLocalizer()).thenReturn(new HapiLocalizer()); when(mockFhirContext.getVersion()).thenReturn(FhirVersionEnum.R4.getVersionImplementation()); when(mockValidationSupport.getFhirContext()).thenReturn(mockFhirContext); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2/hapi/validation/FhirInstanceValidatorDstu2Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2/hapi/validation/FhirInstanceValidatorDstu2Test.java index 69c4d82cb8cb..19c99a41a857 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2/hapi/validation/FhirInstanceValidatorDstu2Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2/hapi/validation/FhirInstanceValidatorDstu2Test.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.model.dstu2.composite.PeriodDt; import ca.uhn.fhir.model.dstu2.resource.Parameters; import ca.uhn.fhir.model.dstu2.resource.Patient; @@ -39,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class FhirInstanceValidatorDstu2Test { +public class FhirInstanceValidatorDstu2Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirInstanceValidatorDstu2Test.class); private static FhirContext ourCtxDstu2 = FhirContext.forDstu2(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2016may/hapi/validation/ResourceValidatorDstu2_1Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2016may/hapi/validation/ResourceValidatorDstu2_1Test.java index 9f07f2ba1648..7f570c213149 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2016may/hapi/validation/ResourceValidatorDstu2_1Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu2016may/hapi/validation/ResourceValidatorDstu2_1Test.java @@ -1,6 +1,7 @@ package org.hl7.fhir.dstu2016may.hapi.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.parser.IParser; @@ -34,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -public class ResourceValidatorDstu2_1Test { +public class ResourceValidatorDstu2_1Test extends BaseValidationTestWithInlineMocks { private static FhirContext ourCtx = FhirContext.forDstu2_1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceValidatorDstu2_1Test.class); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/elementmodel/PropertyDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/elementmodel/PropertyDstu3Test.java index d19e442503c2..862fd7cf7614 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/elementmodel/PropertyDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/elementmodel/PropertyDstu3Test.java @@ -2,6 +2,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.parser.IParser; import org.apache.commons.io.IOUtils; import org.hl7.fhir.dstu3.hapi.ctx.HapiWorkerContext; @@ -22,7 +23,7 @@ /** * Created by axemj on 14/07/2017. */ -public class PropertyDstu3Test { +public class PropertyDstu3Test extends BaseValidationTestWithInlineMocks { private static final FhirContext ourCtx = FhirContext.forDstu3(); private Property property; diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR4Test.java index adc1b855c919..d646825ec4a1 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR4Test.java @@ -2,6 +2,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import org.hl7.fhir.r4.model.CodeSystem; import org.junit.jupiter.api.Test; @@ -9,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -public class DefaultProfileValidationSupportR4Test { +public class DefaultProfileValidationSupportR4Test extends BaseValidationTestWithInlineMocks { private static FhirContext ourCtx = FhirContext.forR4Cached(); private DefaultProfileValidationSupport mySvc = new DefaultProfileValidationSupport(ourCtx); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR5Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR5Test.java index 976fe35c87b4..7efa71761123 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR5Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/DefaultProfileValidationSupportR5Test.java @@ -2,6 +2,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.StructureDefinition; import org.junit.jupiter.api.Test; @@ -11,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class DefaultProfileValidationSupportR5Test { +public class DefaultProfileValidationSupportR5Test extends BaseValidationTestWithInlineMocks { private static FhirContext ourCtx = FhirContext.forR5Cached(); private DefaultProfileValidationSupport mySvc = new DefaultProfileValidationSupport(ourCtx); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java index 86b6f028ad84..a648bad27665 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java @@ -5,6 +5,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.context.support.ValueSetExpansionOptions; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.test.utilities.LoggingExtension; import ca.uhn.fhir.util.ClasspathUtil; import ca.uhn.fhir.util.TestUtil; @@ -64,11 +65,11 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.mockito.invocation.InvocationOnMock; +import org.mockito.quality.Strictness; import org.mockito.stubbing.Answer; import java.io.IOException; import java.io.InputStream; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -98,8 +99,9 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.withSettings; -public class FhirInstanceValidatorDstu3Test { +public class FhirInstanceValidatorDstu3Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirInstanceValidatorDstu3Test.class); private static FhirContext ourCtx = FhirContext.forDstu3Cached(); @@ -129,7 +131,7 @@ public void before() { myVal.setValidateAgainstStandardSchema(false); myVal.setValidateAgainstStandardSchematron(false); - IValidationSupport mockSupport = mock(IValidationSupport.class); + IValidationSupport mockSupport = mock(IValidationSupport.class, withSettings().strictness(Strictness.LENIENT)); when(mockSupport.getFhirContext()).thenReturn(ourCtx); myValidationSupport = new CachingValidationSupport(new ValidationSupportChain( mockSupport, @@ -292,10 +294,6 @@ private Object defaultString(Integer theLocationLine) { return theLocationLine != null ? theLocationLine.toString() : ""; } - private String loadResource(String theFileName) throws IOException { - return IOUtils.toString(FhirInstanceValidatorDstu3Test.class.getResourceAsStream(theFileName), Charsets.UTF_8); - } - private T loadResource(String theFilename, Class theType) throws IOException { return ourCtx.newJsonParser().parseResource(theType, loadResource(theFilename)); } diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java index 811270fc883e..a9098c06312f 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.FhirValidator; @@ -47,6 +48,9 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.ArrayList; import java.util.Collections; @@ -67,11 +71,11 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.nullable; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.when; +@ExtendWith(MockitoExtension.class) public class QuestionnaireResponseValidatorDstu3Test { private static final String QUESTIONNAIRE_URL = "http://example.com/Questionnaire/q1"; private static final IdType ID_ICC_QUESTIONNAIRE_SETUP = new IdType("Questionnaire/profile"); @@ -83,11 +87,11 @@ public class QuestionnaireResponseValidatorDstu3Test { private static DefaultProfileValidationSupport myDefaultValidationSupport = new DefaultProfileValidationSupport(ourCtx); private FhirInstanceValidator myInstanceVal; private FhirValidator myVal; + @Mock(strictness = Mock.Strictness.LENIENT) private IValidationSupport myValSupport; @BeforeEach public void before() { - myValSupport = mock(IValidationSupport.class); when(myValSupport.getFhirContext()).thenReturn(ourCtx); myVal = ourCtx.newValidator(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireValidatorDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireValidatorDstu3Test.java index 0bdd566968bd..cc9479411850 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireValidatorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireValidatorDstu3Test.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ResultSeverityEnum; @@ -32,7 +33,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class QuestionnaireValidatorDstu3Test { +public class QuestionnaireValidatorDstu3Test extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(QuestionnaireValidatorDstu3Test.class); private static FhirContext ourCtx = FhirContext.forDstu3(); private static DefaultProfileValidationSupport myDefaultValidationSupport = new DefaultProfileValidationSupport(ourCtx); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java index 8e4f2f0209d2..4764a13641c6 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java @@ -2,6 +2,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.ResourceDef; @@ -24,11 +25,23 @@ import org.hl7.fhir.dstu3.conformance.ProfileUtilities; import org.hl7.fhir.dstu3.context.IWorkerContext; import org.hl7.fhir.dstu3.hapi.ctx.HapiWorkerContext; -import org.hl7.fhir.dstu3.model.*; +import org.hl7.fhir.dstu3.model.CareTeam; +import org.hl7.fhir.dstu3.model.CodeableConcept; +import org.hl7.fhir.dstu3.model.Coding; +import org.hl7.fhir.dstu3.model.Condition; import org.hl7.fhir.dstu3.model.Condition.ConditionClinicalStatus; import org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus; +import org.hl7.fhir.dstu3.model.Consent; +import org.hl7.fhir.dstu3.model.DateType; +import org.hl7.fhir.dstu3.model.EligibilityResponse; import org.hl7.fhir.dstu3.model.EligibilityResponse.BenefitComponent; import org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus; +import org.hl7.fhir.dstu3.model.OperationOutcome; +import org.hl7.fhir.dstu3.model.Patient; +import org.hl7.fhir.dstu3.model.Questionnaire; +import org.hl7.fhir.dstu3.model.Reference; +import org.hl7.fhir.dstu3.model.StringType; +import org.hl7.fhir.dstu3.model.StructureDefinition; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.junit.jupiter.api.AfterAll; @@ -49,7 +62,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -public class ResourceValidatorDstu3Test { +public class ResourceValidatorDstu3Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceValidatorDstu3Test.class); private static FhirContext ourCtx = FhirContext.forDstu3(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchemaValidationDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchemaValidationDstu3Test.java index 7290cb9b3cba..946a9045b229 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchemaValidationDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchemaValidationDstu3Test.java @@ -1,6 +1,7 @@ package org.hl7.fhir.dstu3.hapi.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ValidationResult; @@ -11,7 +12,7 @@ import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertFalse; -public class SchemaValidationDstu3Test { +public class SchemaValidationDstu3Test extends BaseValidationTestWithInlineMocks { static { diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchematronValidationDstu3QuestionnaireTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchematronValidationDstu3QuestionnaireTest.java index dfe95cf4a69a..dbd497ca82f2 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchematronValidationDstu3QuestionnaireTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/SchematronValidationDstu3QuestionnaireTest.java @@ -1,6 +1,7 @@ package org.hl7.fhir.dstu3.hapi.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ValidationResult; @@ -21,7 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class SchematronValidationDstu3QuestionnaireTest { +public class SchematronValidationDstu3QuestionnaireTest extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(SchematronValidationDstu3QuestionnaireTest.class); private static FhirContext ourCtx = FhirContext.forDstu3(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/StructureMapTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/StructureMapTest.java index 9191c91c0b05..0336857dc360 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/StructureMapTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/StructureMapTest.java @@ -2,6 +2,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import org.hl7.fhir.common.hapi.validation.support.PrePopulatedValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; import org.hl7.fhir.dstu3.context.IWorkerContext; @@ -20,7 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class StructureMapTest { +public class StructureMapTest extends BaseValidationTestWithInlineMocks { /** * The logger object. diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java index d524e0387b39..62f7781d59ae 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java @@ -2,11 +2,11 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.util.TestUtil; import org.hl7.fhir.dstu3.hapi.ctx.HapiWorkerContext; import org.hl7.fhir.dstu3.model.Base; import org.hl7.fhir.dstu3.model.BooleanType; -import org.hl7.fhir.dstu3.model.ContactPoint; import org.hl7.fhir.dstu3.model.DateTimeType; import org.hl7.fhir.dstu3.model.Observation; import org.hl7.fhir.dstu3.model.Patient; @@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class FhirPathEngineTest { +public class FhirPathEngineTest extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirPathEngineTest.class); private static FhirContext ourCtx = FhirContext.forDstu3(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/utils/FhirPathEngineR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/utils/FhirPathEngineR4Test.java index cb4029ab6e6f..e349ab9b1727 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/utils/FhirPathEngineR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/utils/FhirPathEngineR4Test.java @@ -1,6 +1,7 @@ package org.hl7.fhir.r4.utils; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.util.TestUtil; import org.hl7.fhir.dstu3.utils.FhirPathEngineTest; @@ -30,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class FhirPathEngineR4Test { +public class FhirPathEngineR4Test extends BaseValidationTestWithInlineMocks { private static final FhirContext ourCtx = FhirContext.forR4Cached(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirPathEngineTest.class); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/CustomResourceGenerationTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/CustomResourceGenerationTest.java index 518f9057f1e1..6f87aa0269ec 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/CustomResourceGenerationTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/CustomResourceGenerationTest.java @@ -1,10 +1,10 @@ package org.hl7.fhir.r4.validation; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.test.BaseTest; +import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ValidationResult; -import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import org.hl7.fhir.common.hapi.validation.support.PrePopulatedValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator; @@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class CustomResourceGenerationTest extends BaseTest { +public class CustomResourceGenerationTest extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(CustomResourceGenerationTest.class); private FhirContext myCtx = FhirContext.forR4(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FHIRPathResourceGeneratorR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FHIRPathResourceGeneratorR4Test.java index 1771c78bbd88..6201ee6f9258 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FHIRPathResourceGeneratorR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FHIRPathResourceGeneratorR4Test.java @@ -3,6 +3,7 @@ import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import org.hl7.fhir.common.hapi.validation.validator.FHIRPathResourceGeneratorR4; import org.hl7.fhir.r4.model.Address; import org.hl7.fhir.r4.model.HumanName; @@ -16,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class FHIRPathResourceGeneratorR4Test { +public class FHIRPathResourceGeneratorR4Test extends BaseValidationTestWithInlineMocks { public Map createFhirMapping() { Map mapping = new HashMap<>(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java index 7f29442a01af..c95e48111ec3 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java @@ -7,8 +7,8 @@ import ca.uhn.fhir.context.support.LookupCodeRequest; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.context.support.ValueSetExpansionOptions; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.rest.api.Constants; -import ca.uhn.fhir.test.BaseTest; import ca.uhn.fhir.test.utilities.LoggingExtension; import ca.uhn.fhir.util.BundleBuilder; import ca.uhn.fhir.util.StopWatch; @@ -120,7 +120,7 @@ import static org.mockito.Mockito.when; import static org.mockito.Mockito.withSettings; -public class FhirInstanceValidatorR4Test extends BaseTest { +public class FhirInstanceValidatorR4Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirInstanceValidatorR4Test.class); private static FhirContext ourCtx = FhirContext.forR4(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/HapiWorkerContextTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/HapiWorkerContextTest.java index df14ec8ccbd2..411290f9d4ff 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/HapiWorkerContextTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/HapiWorkerContextTest.java @@ -1,8 +1,8 @@ package org.hl7.fhir.r4.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; -import ca.uhn.fhir.test.BaseTest; import com.google.common.base.Charsets; import org.apache.commons.lang.Validate; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; @@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class HapiWorkerContextTest extends BaseTest { +public class HapiWorkerContextTest extends BaseValidationTestWithInlineMocks { FhirContext myCtx = FhirContext.forR4(); @Test diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/LocalFileValidationSupportTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/LocalFileValidationSupportTest.java index a8b1b7566ff3..6cc553e51366 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/LocalFileValidationSupportTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/LocalFileValidationSupportTest.java @@ -1,29 +1,19 @@ package org.hl7.fhir.r4.validation; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; -import ca.uhn.fhir.context.support.ValidationSupportContext; -import ca.uhn.fhir.parser.IParser; -import ca.uhn.fhir.rest.api.EncodingEnum; -import org.apache.commons.io.IOUtils; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import org.hl7.fhir.common.hapi.validation.support.LocalFileValidationSupport; -import org.hl7.fhir.common.hapi.validation.support.SnapshotGeneratingValidationSupport; -import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; -import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.StructureDefinition; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.BufferedInputStream; import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; -public class LocalFileValidationSupportTest { +public class LocalFileValidationSupportTest extends BaseValidationTestWithInlineMocks { private FhirContext myFhirCtx = FhirContext.forR4(); private static final Logger ourLog = LoggerFactory.getLogger(LocalFileValidationSupportTest.class); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/NpmPackageValidationSupportTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/NpmPackageValidationSupportTest.java index 4c8f5b87aa0a..9549e2ad2ad1 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/NpmPackageValidationSupportTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/NpmPackageValidationSupportTest.java @@ -2,8 +2,10 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ValidationResult; +import jakarta.annotation.Nonnull; import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport; import org.hl7.fhir.common.hapi.validation.support.CommonCodeSystemsTerminologyService; import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; @@ -16,7 +18,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Map; @@ -24,7 +25,7 @@ import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertArrayEquals; -public class NpmPackageValidationSupportTest { +public class NpmPackageValidationSupportTest extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(NpmPackageValidationSupportTest.class); private FhirContext myFhirContext = FhirContext.forR4Cached(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/ParserWithValidationR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/ParserWithValidationR4Test.java index 5089809f277b..780562ee882b 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/ParserWithValidationR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/ParserWithValidationR4Test.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ValidationResult; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; @@ -10,13 +11,13 @@ import org.hl7.fhir.r4.model.MedicationRequest; import org.junit.jupiter.api.Test; -import static ca.uhn.fhir.util.ClasspathUtil.loadResource; +import java.io.IOException; -public class ParserWithValidationR4Test { +public class ParserWithValidationR4Test extends BaseValidationTestWithInlineMocks { private static final FhirContext ourCtx = FhirContext.forR4(); @Test - public void testActivityDefinitionElementsOrder() { + public void testActivityDefinitionElementsOrder() throws IOException { ourCtx.setValidationSupport(getValidationSupport()); MedicationRequest med_req = ourCtx.newJsonParser().parseResource(MedicationRequest.class, loadResource("/r4/amz/medication-request-amz.json")); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireResponseValidatorR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireResponseValidatorR4Test.java index ff04bbba907b..57d53819946d 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireResponseValidatorR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireResponseValidatorR4Test.java @@ -13,16 +13,37 @@ import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator; -import org.hl7.fhir.r4.model.*; +import org.hl7.fhir.r4.model.Attachment; +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode; +import org.hl7.fhir.r4.model.Coding; +import org.hl7.fhir.r4.model.DateTimeType; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.DecimalType; +import org.hl7.fhir.r4.model.IntegerType; +import org.hl7.fhir.r4.model.MarkdownType; +import org.hl7.fhir.r4.model.Narrative; +import org.hl7.fhir.r4.model.Quantity; +import org.hl7.fhir.r4.model.Questionnaire; import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent; import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType; +import org.hl7.fhir.r4.model.QuestionnaireResponse; import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent; import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus; +import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.StringType; +import org.hl7.fhir.r4.model.TimeType; +import org.hl7.fhir.r4.model.Type; +import org.hl7.fhir.r4.model.UriType; +import org.hl7.fhir.r4.model.ValueSet; import org.hl7.fhir.utilities.xhtml.XhtmlNode; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.ArrayList; import java.util.Arrays; @@ -40,9 +61,9 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.nullable; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +@ExtendWith(MockitoExtension.class) public class QuestionnaireResponseValidatorR4Test { public static final String ID_ICC_QUESTIONNAIRE_SETUP = "http://example.com/Questionnaire/profile"; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(QuestionnaireResponseValidatorR4Test.class); @@ -53,11 +74,11 @@ public class QuestionnaireResponseValidatorR4Test { private static DefaultProfileValidationSupport myDefaultValidationSupport = new DefaultProfileValidationSupport(ourCtx); private FhirInstanceValidator myInstanceVal; private FhirValidator myVal; + @Mock(strictness = Mock.Strictness.LENIENT) private IValidationSupport myValSupport; @BeforeEach public void before() { - myValSupport = mock(IValidationSupport.class); when(myValSupport.getFhirContext()).thenReturn(ourCtx); myVal = ourCtx.newValidator(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireValidatorR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireValidatorR4Test.java index 1453e19f61e2..8ab2956055e6 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireValidatorR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/QuestionnaireValidatorR4Test.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ResultSeverityEnum; @@ -32,7 +33,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class QuestionnaireValidatorR4Test { +public class QuestionnaireValidatorR4Test extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(QuestionnaireValidatorR4Test.class); private static FhirContext ourCtx = FhirContext.forR4(); private static DefaultProfileValidationSupport myDefaultValidationSupport = new DefaultProfileValidationSupport(ourCtx); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/RemoteTerminologyServiceValidationSupportR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/RemoteTerminologyServiceValidationSupportR4Test.java index eca05ae6d058..eaa13bd30ac3 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/RemoteTerminologyServiceValidationSupportR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/RemoteTerminologyServiceValidationSupportR4Test.java @@ -5,6 +5,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.TranslateConceptResult; import ca.uhn.fhir.context.support.TranslateConceptResults; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.jpa.model.util.JpaConstants; import ca.uhn.fhir.parser.IJsonLikeParser; import ca.uhn.fhir.rest.annotation.IdParam; @@ -58,7 +59,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class RemoteTerminologyServiceValidationSupportR4Test { +public class RemoteTerminologyServiceValidationSupportR4Test extends BaseValidationTestWithInlineMocks { private static final String DISPLAY = "DISPLAY"; private static final String CODE_SYSTEM = "CODE_SYS"; private static final String CODE_SYSTEM_NAME = "Code System"; diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SchemaValidationR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SchemaValidationR4Test.java index 8744d000d34f..edb48d638af4 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SchemaValidationR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SchemaValidationR4Test.java @@ -1,6 +1,7 @@ package org.hl7.fhir.r4.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ValidationResult; @@ -14,7 +15,6 @@ import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.TransformerFactory; import javax.xml.xpath.XPathFactory; - import java.security.CodeSource; import java.text.MessageFormat; @@ -22,7 +22,7 @@ import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertFalse; -public class SchemaValidationR4Test { +public class SchemaValidationR4Test extends BaseValidationTestWithInlineMocks { private static final Logger ourLog = LoggerFactory.getLogger(SchemaValidationR4Test.class); private static FhirContext ourCtx = FhirContext.forDstu3(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SnapshotGeneratorR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SnapshotGeneratorR4Test.java index e0546152516e..f640079fbe70 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SnapshotGeneratorR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/SnapshotGeneratorR4Test.java @@ -1,11 +1,12 @@ package org.hl7.fhir.r4.validation; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.ValidationSupportContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.rest.api.EncodingEnum; import org.apache.commons.io.IOUtils; -import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import org.hl7.fhir.common.hapi.validation.support.SnapshotGeneratingValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -21,7 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; -public class SnapshotGeneratorR4Test { +public class SnapshotGeneratorR4Test extends BaseValidationTestWithInlineMocks { private FhirContext myFhirCtx = FhirContext.forR4(); private static final Logger ourLog = LoggerFactory.getLogger(SnapshotGeneratorR4Test.class); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/XverExtensionsValidationTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/XverExtensionsValidationTest.java index 4be0cf8cb287..366fb3c42b4d 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/XverExtensionsValidationTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/XverExtensionsValidationTest.java @@ -3,10 +3,12 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.SingleValidationMessage; import ca.uhn.fhir.validation.ValidationResult; +import jakarta.annotation.Nonnull; import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport; import org.hl7.fhir.common.hapi.validation.support.NpmPackageValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; @@ -15,14 +17,12 @@ import org.hl7.fhir.r4.model.MedicationRequest; import org.junit.jupiter.api.Test; -import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.function.Predicate; -import static ca.uhn.fhir.util.ClasspathUtil.loadResource; import static org.junit.jupiter.api.Assertions.assertEquals; -public class XverExtensionsValidationTest { +public class XverExtensionsValidationTest extends BaseValidationTestWithInlineMocks { private static final FhirContext ourCtx = FhirContext.forR4(); @Test @@ -80,7 +80,7 @@ private static FhirValidator getFhirValidator() { } @Nonnull - private static MedicationRequest getMedicationRequest() { + private MedicationRequest getMedicationRequest() throws IOException { MedicationRequest med_req; med_req = ourCtx.newJsonParser().parseResource(MedicationRequest.class, loadResource("/r4/amz/medication-request-amz.json")); return med_req; diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4b/validation/FhirInstanceValidatorR4BTest.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4b/validation/FhirInstanceValidatorR4BTest.java index f700c6e67441..780cecce079e 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4b/validation/FhirInstanceValidatorR4BTest.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4b/validation/FhirInstanceValidatorR4BTest.java @@ -7,8 +7,8 @@ import ca.uhn.fhir.context.support.LookupCodeRequest; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.context.support.ValueSetExpansionOptions; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.rest.api.Constants; -import ca.uhn.fhir.test.BaseTest; import ca.uhn.fhir.test.utilities.LoggingExtension; import ca.uhn.fhir.util.BundleBuilder; import ca.uhn.fhir.util.StopWatch; @@ -109,7 +109,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class FhirInstanceValidatorR4BTest extends BaseTest { +public class FhirInstanceValidatorR4BTest extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirInstanceValidatorR4BTest.class); private static final FhirContext ourCtx = FhirContext.forR4BCached(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/utils/GraphQLEngineR5Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/utils/GraphQLEngineR5Test.java index f7e774e29446..7d4a4ca3c101 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/utils/GraphQLEngineR5Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/utils/GraphQLEngineR5Test.java @@ -1,6 +1,7 @@ package org.hl7.fhir.r5.utils; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.util.TestUtil; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.hapi.ctx.HapiWorkerContext; @@ -27,7 +28,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class GraphQLEngineR5Test { +public class GraphQLEngineR5Test extends BaseValidationTestWithInlineMocks { private static final FhirContext ourCtx = FhirContext.forR5Cached(); private static final HapiWorkerContext ourWorkerCtx = new HapiWorkerContext(ourCtx, ourCtx.getValidationSupport()); private org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(GraphQLEngineR5Test.class); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/FhirInstanceValidatorR5Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/FhirInstanceValidatorR5Test.java index 9e5a0d54da11..2f825294a783 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/FhirInstanceValidatorR5Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/FhirInstanceValidatorR5Test.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.context.support.ValueSetExpansionOptions; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.test.utilities.LoggingExtension; import ca.uhn.fhir.util.TestUtil; @@ -42,7 +43,7 @@ import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent; -import org.hl7.fhir.r5.terminologies.expansion.ValueSetExpander;; +; import org.hl7.fhir.r5.terminologies.expansion.ValueSetExpansionOutcome; import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor; import org.hl7.fhir.r5.utils.validation.IValidatorResourceFetcher; @@ -84,7 +85,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class FhirInstanceValidatorR5Test { +public class FhirInstanceValidatorR5Test extends BaseValidationTestWithInlineMocks { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirInstanceValidatorR5Test.class); private static FhirContext ourCtx = FhirContext.forR5(); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/QuestionnaireResponseValidatorR5Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/QuestionnaireResponseValidatorR5Test.java index fb4ca989a510..c66d40025a8b 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/QuestionnaireResponseValidatorR5Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/QuestionnaireResponseValidatorR5Test.java @@ -16,12 +16,12 @@ import org.hl7.fhir.r5.model.Attachment; import org.hl7.fhir.r5.model.BooleanType; import org.hl7.fhir.r5.model.CodeSystem; -import org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.DataType; import org.hl7.fhir.r5.model.DateTimeType; import org.hl7.fhir.r5.model.DateType; import org.hl7.fhir.r5.model.DecimalType; +import org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode; import org.hl7.fhir.r5.model.IntegerType; import org.hl7.fhir.r5.model.MarkdownType; import org.hl7.fhir.r5.model.Narrative; @@ -41,6 +41,7 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.mockito.quality.Strictness; import java.util.ArrayList; import java.util.Arrays; @@ -59,8 +60,9 @@ import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.withSettings; -public class QuestionnaireResponseValidatorR5Test { +public class QuestionnaireResponseValidatorR5Test { public static final String ID_ICC_QUESTIONNAIRE_SETUP = "http://example.com/Questionnaire/profile"; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(QuestionnaireResponseValidatorR5Test.class); private static final String CODE_ICC_SCHOOLTYPE_PT = "PT"; @@ -75,7 +77,7 @@ public class QuestionnaireResponseValidatorR5Test { @BeforeEach public void before() { - myValSupport = mock(IValidationSupport.class); + myValSupport = mock(IValidationSupport.class, withSettings().strictness(Strictness.LENIENT)); when(myValSupport.getFhirContext()).thenReturn(ourCtx); myWorkerCtx = new HapiWorkerContext(ourCtx, myValSupport); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/RemoteTerminologyServiceValidationSupportR5Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/RemoteTerminologyServiceValidationSupportR5Test.java index 0e9485bae4df..bc691a1e2d6d 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/RemoteTerminologyServiceValidationSupportR5Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r5/validation/RemoteTerminologyServiceValidationSupportR5Test.java @@ -3,6 +3,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.context.support.LookupCodeRequest; +import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks; import ca.uhn.fhir.test.utilities.server.RestfulServerExtension; import org.hl7.fhir.common.hapi.validation.support.RemoteTerminologyServiceValidationSupport; import org.junit.jupiter.api.Assertions; @@ -10,7 +11,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -public class RemoteTerminologyServiceValidationSupportR5Test { +public class RemoteTerminologyServiceValidationSupportR5Test extends BaseValidationTestWithInlineMocks { private static final String ANY_NONBLANK_VALUE = "anything"; private static final FhirContext ourCtx = FhirContext.forR5Cached(); @RegisterExtension diff --git a/hapi-tinder-plugin/pom.xml b/hapi-tinder-plugin/pom.xml index 7377923615e3..2ae0bc8c323f 100644 --- a/hapi-tinder-plugin/pom.xml +++ b/hapi-tinder-plugin/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/hapi-tinder-test/pom.xml b/hapi-tinder-test/pom.xml index 3f280f526e56..2a5d2aeef800 100644 --- a/hapi-tinder-test/pom.xml +++ b/hapi-tinder-test/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 720a9ff2a355..10f3b74cd68c 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ca.uhn.hapi.fhir hapi-fhir pom - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT HAPI-FHIR An open-source implementation of the FHIR specification in Java. @@ -930,11 +930,11 @@ 2.12.0 1.10.0 2.11.0 - 3.12.0 + 3.14.0 1.2 - 10.14.2.0 + 10.17.1.0 2.23.0 - 4.8.1 + 5.8.0 0.7.9 32.1.1-jre 2.8.9 @@ -949,16 +949,17 @@ 5.10.1 0.64.8 9.4.0 - 6.4.0.Final - 6.2.2.Final + 6.4.1.Final 1.4.14 - - 8.11.2 + + 7.0.0.Final + + 9.8.0 2.2 8.0.0.Final 4.4.13 4.5.13 - 2.16.0 + 2.16.1 2.16.0 3.3.0 1.8 @@ -1253,7 +1254,7 @@ org.apache.commons commons-csv - 1.8 + 1.10.0 org.aspectj @@ -1432,7 +1433,7 @@ net.ttddyy datasource-proxy - 1.9 + 1.10 org.antlr @@ -1549,12 +1550,7 @@ org.apache.lucene - lucene-analyzers-phonetic - ${lucene_version} - - - org.apache.lucene - lucene-backward-codecs + lucene-analysis-phonetic ${lucene_version} @@ -1893,7 +1889,7 @@ org.hibernate.search - hibernate-search-mapper-orm-orm6 + hibernate-search-mapper-orm ${hibernate_search_version} diff --git a/release-pipeline.yml b/release-pipeline.yml index 62a3475771a4..6142cc53b916 100644 --- a/release-pipeline.yml +++ b/release-pipeline.yml @@ -36,7 +36,7 @@ jobs: displayName: Print out pom version. - task: Bash@3 # Determines the new release tag label. For existing release branches, this is straightforward, - # as we just take the current project pom version (ie. 5.7.1). However, for the current master + # as we just take the current project pom version (i.e. 5.7.1). However, for the current master # branch we often have a branch name like "6.1.5-PRE2-SNAPSHOT", in which case, we need to normalize # the release label from that project version to get the "maj.min.patch" version we will release. inputs: @@ -134,13 +134,13 @@ jobs: PathtoPublish: '$(build.artifactstagingdirectory)' - job: buildaroni - # We're going to do a full build, including all unit and intergration tests. We do this here, before any - # actual release pipeilne kicks off, and we don't do it again at any point in the release pipeline. The assumption here + # We're going to do a full build, including all unit and integration tests. We do this here, before any + # actual release pipeline kicks off, and we don't do it again at any point in the release pipeline. The assumption here # is that once we pull the code, it won't change again on this branch until the release is complete. We - # want to fail fast if there is an issue, and avoid running the tests more than once so it doesn't take all day. + # want to fail fast if there is an issue, and avoid running the tests more than once, so it doesn't take all day. timeoutInMinutes: 360 dependsOn: ['get_release_version', 'get_branch_id'] - container: maven:3.8-openjdk-17 + container: maven:3.9-eclipse-temurin-21-jammy steps: - task: Cache@2 inputs: @@ -153,7 +153,7 @@ jobs: releaseType: stable - task: Maven@3 env: - JAVA_HOME_11_X64: /usr/java/openjdk-17 + JAVA_HOME_11_X64: /usr/java/openjdk displayName: Checkstyle Build inputs: mavenPomFile: 'hapi-fhir-checkstyle/pom.xml' @@ -166,7 +166,7 @@ jobs: script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) - task: Maven@3 env: - JAVA_HOME_11_X64: /usr/java/openjdk-17 + JAVA_HOME_11_X64: /opt/java/openjdk inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy diff --git a/snapshot-pipeline.yml b/snapshot-pipeline.yml index dfb2b65e5108..08c148eb116a 100644 --- a/snapshot-pipeline.yml +++ b/snapshot-pipeline.yml @@ -24,7 +24,7 @@ variables: - group: GPG_VARIABLE_GROUP - group: SONATYPE_VARIABLE_GROUP -container: maven:3.8-openjdk-17 +container: maven:3.9-eclipse-temurin-21-jammy steps: # We need a valid signing key to sign our builds for deployment to sonatype. We have uploaded @@ -92,7 +92,7 @@ steps: # 5. Deploy SNAPSHOT build to sonatype - task: Maven@3 env: - JAVA_HOME_11_X64: /usr/java/openjdk-17 + JAVA_HOME_11_X64: /opt/java/openjdk displayName: 'Deploy to Sonatype staging' inputs: mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml' diff --git a/test-job-template.yml b/test-job-template.yml index 8ea5be78a42b..ae998da96c63 100644 --- a/test-job-template.yml +++ b/test-job-template.yml @@ -7,7 +7,7 @@ jobs: - job: setup displayName: setup-and-cache-build timeoutInMinutes: 60 - container: maven:3.8-openjdk-17 + container: maven:3.9-eclipse-temurin-21-jammy pool: vmImage: ubuntu-latest steps: @@ -23,7 +23,7 @@ jobs: script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) - task: Maven@3 env: - JAVA_HOME_11_X64: /usr/java/openjdk-17 + JAVA_HOME_11_X64: /opt/java/openjdk inputs: goals: 'install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy @@ -36,7 +36,7 @@ jobs: timeoutInMinutes: 60 displayName: ${{ p.name }} dependsOn: [ 'setup' ] - container: maven:3.8-openjdk-17 + container: maven:3.9-eclipse-temurin-21-jammy pool: vmImage: ubuntu-latest steps: @@ -55,7 +55,7 @@ jobs: path: $(MAVEN_CACHE_FOLDER) - task: Maven@3 env: - JAVA_HOME_11_X64: /usr/java/openjdk-17 + JAVA_HOME_11_X64: /opt/java/openjdk inputs: mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml' goals: 'clean verify jacoco:report -pl ${{ p.module }}' @@ -90,7 +90,7 @@ jobs: vmImage: ubuntu-latest timeoutInMinutes: 60 displayName: generate_test_reports - container: maven:3.8-openjdk-17 + container: maven:3.9-eclipse-temurin-21-jammy dependsOn: - ${{ each p in parameters.modules }}: - ${{ p.name }} @@ -119,7 +119,7 @@ jobs: targetFolder: '$(System.DefaultWorkingDirectory)/${{ p.module }}/target/' - task: Maven@3 env: - JAVA_HOME_11_X64: /usr/java/openjdk-17 + JAVA_HOME_11_X64: /opt/java/openjdk inputs: mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml' goals: 'jacoco:report-aggregate' diff --git a/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml b/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml index 1959b73c9f57..33a92e0e12b7 100644 --- a/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml +++ b/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../../pom.xml diff --git a/tests/hapi-fhir-base-test-mindeps-client/pom.xml b/tests/hapi-fhir-base-test-mindeps-client/pom.xml index 570797823ca9..e7b8c1b886e3 100644 --- a/tests/hapi-fhir-base-test-mindeps-client/pom.xml +++ b/tests/hapi-fhir-base-test-mindeps-client/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../../pom.xml diff --git a/tests/hapi-fhir-base-test-mindeps-server/pom.xml b/tests/hapi-fhir-base-test-mindeps-server/pom.xml index 3443d068a3b0..c9ed824c9094 100644 --- a/tests/hapi-fhir-base-test-mindeps-server/pom.xml +++ b/tests/hapi-fhir-base-test-mindeps-server/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.9-SNAPSHOT + 6.11.10-SNAPSHOT ../../pom.xml