From 55e30d6301b8643d781f0c1759d3c684baacdfec Mon Sep 17 00:00:00 2001 From: Enrico Date: Mon, 20 Jan 2025 14:05:24 -0300 Subject: [PATCH] Clean up tests --- .../export/enrollment/EnrollmentServiceTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/tracker/export/enrollment/EnrollmentServiceTest.java b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/tracker/export/enrollment/EnrollmentServiceTest.java index 975243b0d22..a35b460c462 100644 --- a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/tracker/export/enrollment/EnrollmentServiceTest.java +++ b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/tracker/export/enrollment/EnrollmentServiceTest.java @@ -94,7 +94,7 @@ class EnrollmentServiceTest extends PostgresIntegrationTestBase { private User admin; - private User userWithoutOrgUnit; + private User userWithOrgUnitZ; private User authorizedUser; @@ -146,8 +146,8 @@ void setUp() { User user = createAndAddUser(false, "user", Set.of(orgUnitA), Set.of(orgUnitA), "F_EXPORT_DATA"); user.setTeiSearchOrganisationUnits(Set.of(orgUnitA, orgUnitB, orgUnitC)); - userWithoutOrgUnit = createUserWithAuth("userWithoutOrgUnit"); - userWithoutOrgUnit.setTeiSearchOrganisationUnits(Set.of(orgUnitZ)); + userWithOrgUnitZ = createUserWithAuth("userWithoutOrgUnit"); + userWithOrgUnitZ.setTeiSearchOrganisationUnits(Set.of(orgUnitZ)); authorizedUser = createAndAddUser( false, @@ -407,7 +407,7 @@ void shouldFailGettingEnrollmentWhenUserHasReadAccessToProgramButNoAccessToOrgUn programA.getSharing().setPublicAccess(AccessStringHelper.DATA_READ); manager.updateNoAcl(programA); - injectSecurityContextUser(userWithoutOrgUnit); + injectSecurityContextUser(userWithOrgUnitZ); NotFoundException exception = assertThrows( @@ -423,7 +423,7 @@ void shouldFailGettingEnrollmentWhenUserHasReadWriteAccessToProgramButNoAccessTo programA.getSharing().setPublicAccess(AccessStringHelper.DATA_READ_WRITE); manager.updateNoAcl(programA); - injectSecurityContextUser(userWithoutOrgUnit); + injectSecurityContextUser(userWithOrgUnitZ); NotFoundException exception = assertThrows( @@ -682,7 +682,7 @@ void shouldFailWhenOrgUnitModeAllAndUserNotAuthorized() { @Test void shouldFailWhenUserCanSearchEverywhereModeDescendantsAndOrgUnitNotInSearchScope() { - injectSecurityContextUser(userWithoutOrgUnit); + injectSecurityContextUser(userWithOrgUnitZ); EnrollmentOperationParams operationParams = EnrollmentOperationParams.builder().orgUnitMode(DESCENDANTS).orgUnits(orgUnitA).build(); @@ -762,7 +762,7 @@ void shouldReturnChildrenOfRequestedOrgUnitWhenOrgUnitModeChildren() } @Test - void shouldFailWhenRequestingListOfEnrollmentsAndAtLeastOneNotAccessible() + void shouldReturnEmptyListFailWhenRequestingEnrollmentsAndTheyAreNotAccessible() throws ForbiddenException { injectSecurityContextUser(admin); programA.getSharing().setPublicAccess("rw------");