diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/dev/dsf/fhir/dao/BinaryDaoTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/dev/dsf/fhir/dao/BinaryDaoTest.java index 5d986b815..0375691f3 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/dev/dsf/fhir/dao/BinaryDaoTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/dev/dsf/fhir/dao/BinaryDaoTest.java @@ -525,7 +525,8 @@ public void testReadAccessTriggerSecurityContextVersionSpecificLocal() throws Ex ResearchStudy::getIdElement); } - private void testReadAccessTriggerSecurityContextOrganization1() throws SQLException, Exception + private void testReadAccessTriggerSecurityContextOrganization(Function securityContext) + throws SQLException, Exception { Organization org = new Organization(); org.setActive(true); @@ -539,7 +540,7 @@ private void testReadAccessTriggerSecurityContextOrganization1() throws SQLExcep .create(rS); Binary b = createResource(); - b.setSecurityContext(new Reference(createdRs.getIdElement().toUnqualifiedVersionless())); + b.setSecurityContext(new Reference(securityContext.apply(createdRs))); Binary createdB = dao.create(b); assertReadAccessEntryCount(4, 1, createdRs, READ_ACCESS_TAG_VALUE_LOCAL); @@ -551,13 +552,13 @@ private void testReadAccessTriggerSecurityContextOrganization1() throws SQLExcep @Test public void testReadAccessTriggerSecurityContextOrganization() throws Exception { - testReadAccessTriggerSecurityContextOrganization1(); + testReadAccessTriggerSecurityContextOrganization(rs -> rs.getIdElement().toUnqualifiedVersionless()); } @Test public void testReadAccessTriggerSecurityContextVersionSpecificOrganization() throws Exception { - testReadAccessTriggerSecurityContextOrganization1(); + testReadAccessTriggerSecurityContextOrganization(ResearchStudy::getIdElement); } @Test