diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java index 0426746a21c2..fb219f982a2c 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java +++ b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java @@ -682,7 +682,7 @@ public void validateSearchScope(TrackedEntityQueryParams params, boolean isGridS } private void checkIfMaxTeiLimitIsReached(TrackedEntityQueryParams params, int maxTeiLimit) { - if (maxTeiLimit > 0 && (!params.isPaging() || params.getPageSize().intValue() > maxTeiLimit )) { + if (maxTeiLimit > 0 && (!params.isPaging() || params.getPageSize().intValue() > maxTeiLimit)) { int teCount = trackedEntityStore.getTrackedEntityCountForGridWithMaxTeiLimit(params); if (teCount > maxTeiLimit) { diff --git a/dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityServiceTest.java b/dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityServiceTest.java index 880f89bc431d..cca68235f782 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityServiceTest.java +++ b/dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityServiceTest.java @@ -101,6 +101,7 @@ void setup() { params.setProgram(new Program("Test program")); params.getProgram().setMaxTeiCountToReturn(10); params.setTrackedEntityUids(Set.of("1")); + params.setSkipPaging(true); } @Test diff --git a/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/trackedentity/DefaultTrackedEntityService.java b/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/trackedentity/DefaultTrackedEntityService.java index b6c1fac46109..78a84480dc95 100644 --- a/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/trackedentity/DefaultTrackedEntityService.java +++ b/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/trackedentity/DefaultTrackedEntityService.java @@ -596,7 +596,7 @@ private boolean isProgramMinAttributesViolated(TrackedEntityQueryParams params) } private void checkIfMaxTeiLimitIsReached(TrackedEntityQueryParams params, int maxTeiLimit) { - if (maxTeiLimit > 0 && (!params.isPaging() || params.getPageSize().intValue() > maxTeiLimit )) { + if (maxTeiLimit > 0 && (!params.isPaging() || params.getPageSize().intValue() > maxTeiLimit)) { int teCount = trackedEntityStore.getTrackedEntityCountWithMaxTrackedEntityLimit(params); if (teCount > maxTeiLimit) {