Skip to content

Commit

Permalink
reverted change and fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
hhund committed Dec 18, 2023
1 parent 6364d25 commit b6d8ec7
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ public void testReadAccessTriggerSecurityContextVersionSpecificLocal() throws Ex
ResearchStudy::getIdElement);
}

private void testReadAccessTriggerSecurityContextOrganization1() throws SQLException, Exception
private void testReadAccessTriggerSecurityContextOrganization(Function<ResearchStudy, IdType> securityContext)
throws SQLException, Exception
{
Organization org = new Organization();
org.setActive(true);
Expand All @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit b6d8ec7

Please sign in to comment.