From dfdcfa1365c398711dca0fd507dbce0866fe6ffe Mon Sep 17 00:00:00 2001 From: Diederik Muylwyk Date: Thu, 4 Mar 2021 17:01:39 -0500 Subject: [PATCH] Add failing tests. --- .../src/main/java/ca/uhn/fhir/util/HapiExtensions.java | 2 +- .../ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java | 1 + .../jpa/dao/r4/FhirResourceDaoCreatePlaceholdersR4Test.java | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/HapiExtensions.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/HapiExtensions.java index cd9028542ef..63121a0885d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/HapiExtensions.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/HapiExtensions.java @@ -114,7 +114,7 @@ public class HapiExtensions { /** * URL for boolean extension added to all placeholder resources */ - // FIXME: DM 2021-03-04 - This should probably be removed, and replaced with EXT_RESOURCE_PLACEHOLDER above + // FIXME: DM 2021-03-04 - This should probably be removed, and replaced with EXT_RESOURCE_PLACEHOLDER above. public static final String EXT_RESOURCE_META_PLACEHOLDER = "http://hapifhir.io/fhir/StructureDefinition/resource-meta-placeholder"; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java index f78746bbe6e..f453f3ce643 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java @@ -150,6 +150,7 @@ public class DaoResourceLinkResolver implements IResourceLinkResolver { return Optional.ofNullable(valueOf); } + // FIXME: DM 2021-03-04 - Should we throw an error if the identifier isn't available? Otherwise we get a placeholder with no identifier. private void tryToCopyIdentifierFromReferenceToTargetResource(IBaseReference theSourceReference, RuntimeResourceDefinition theTargetResourceDef, T theTargetResource) { boolean referenceHasIdentifier = theSourceReference.hasIdentifier(); if (referenceHasIdentifier) { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCreatePlaceholdersR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCreatePlaceholdersR4Test.java index cd7016121b7..820f5afe950 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCreatePlaceholdersR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCreatePlaceholdersR4Test.java @@ -177,7 +177,7 @@ public class FhirResourceDaoCreatePlaceholdersR4Test extends BaseJpaR4Test { assertEquals("Patient/999999999999999", outcome.getResources(0,1).get(0).getIdElement().toUnqualifiedVersionless().getValue()); } - // FIXME: DM 2021-03-04 - This test fails; extension isn't being created correctly + // FIXME: DM 2021-03-04 - This test fails; extension isn't being created correctly. @Test public void testCreatePlaceholderExtension_WithUpdateToTarget() { myDaoConfig.setAutoCreatePlaceholderReferenceTargets(true); @@ -222,7 +222,7 @@ public class FhirResourceDaoCreatePlaceholdersR4Test extends BaseJpaR4Test { assertNull(extension); } - // FIXME: DM 2021-03-04 - This test fails; extension isn't being created correctly; probably shouldn't be in meta + // FIXME: DM 2021-03-04 - This test fails; extension isn't being created correctly; probably shouldn't be in meta. @Test public void testCreatePlaceholderMetaExtension_WithUpdateToTarget() { myDaoConfig.setAutoCreatePlaceholderReferenceTargets(true); @@ -286,7 +286,7 @@ public class FhirResourceDaoCreatePlaceholdersR4Test extends BaseJpaR4Test { assertEquals(0, patient.getIdentifier().size()); } - // FIXME: DM 2021-03-04 - This test fails; placeholder identifier isn't populated by default + // FIXME: DM 2021-03-04 - This test fails; placeholder identifier isn't populated by default. @Test public void testCreatePlaceholderWithMatchUrl_PopulateIdentifierSetToDefault_WithUpdateToTarget() { myDaoConfig.setAutoCreatePlaceholderReferenceTargets(true);