diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/DataQueryServiceTest.java b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/DataQueryServiceTest.java index 1b18a4c5577..d798cfb0fe6 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/DataQueryServiceTest.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/DataQueryServiceTest.java @@ -88,7 +88,8 @@ void testGetUserOrgUnitsWithNoAnalyticsOrganisationUnitsDefined() { DataQueryParams.newBuilder().withUserOrgUnitType(DATA_OUTPUT).build(); User currentUser = mock(User.class); AnalyticsSecurityManager analyticsSecurityManager = mock(AnalyticsSecurityManager.class); - when(currentUser.getDataViewOrganisationUnits()).thenReturn(Set.of(ouA)); + when(currentUser.getOrganisationUnits()).thenReturn(Set.of(ouA)); + when(currentUser.getDataViewOrganisationUnits()).thenReturn(Set.of()); when(analyticsSecurityManager.getCurrentUser(dataQueryParams)).thenReturn(currentUser); DataQueryService dataQueryService = new DefaultDataQueryService( @@ -113,6 +114,7 @@ void testGetUserOrgUnitsWithNoneOrganisationUnitDefined() { DataQueryParams.newBuilder().withUserOrgUnitType(DATA_OUTPUT).build(); User currentUser = mock(User.class); AnalyticsSecurityManager analyticsSecurityManager = mock(AnalyticsSecurityManager.class); + when(currentUser.getOrganisationUnits()).thenReturn(Set.of()); when(currentUser.getDataViewOrganisationUnits()).thenReturn(Set.of()); when(analyticsSecurityManager.getCurrentUser(dataQueryParams)).thenReturn(currentUser); DataQueryService dataQueryService =