Skip to content

Commit

Permalink
fix: (2.39) Incorrect follow-up value while saving working list[DHIS2…
Browse files Browse the repository at this point in the history
…-18206] (#18846)
  • Loading branch information
zubaira authored Oct 17, 2024
1 parent 8156e65 commit 80bebb7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class EntityQueryCriteria implements Serializable {
* Property indicating whether to filter tracked entity instances whose enrollments are marked for
* followup or not
*/
private Boolean followUp = false;
private Boolean followUp;

/** Property indication the OU for the filter. */
private String organisationUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,25 @@ void testAddGet() {
assertEquals(trackedEntityInstanceFilterB, trackedEntityInstanceFilterService.get(idB));
}

@Test
void testAddFilterWithAndWithoutFollowUp() {
TrackedEntityInstanceFilter filterWithOutFollowUp =
createTrackedEntityInstanceFilter('A', programA);
TrackedEntityInstanceFilter filterWithFollowUp =
createTrackedEntityInstanceFilter('B', programB);
filterWithFollowUp.getEntityQueryCriteria().setFollowUp(true);

long idA = trackedEntityInstanceFilterService.add(filterWithOutFollowUp);
long idB = trackedEntityInstanceFilterService.add(filterWithFollowUp);
TrackedEntityInstanceFilter fetchedA = trackedEntityInstanceFilterService.get(idA);
TrackedEntityInstanceFilter fetchedB = trackedEntityInstanceFilterService.get(idB);

assertEquals(filterWithOutFollowUp, fetchedA);
assertNull(fetchedA.getEntityQueryCriteria().getFollowUp());
assertEquals(filterWithFollowUp, trackedEntityInstanceFilterService.get(idB));
assertTrue(fetchedB.getEntityQueryCriteria().getFollowUp());
}

@Test
void testDefaultPrivateAccess() {
long idA =
Expand Down

0 comments on commit 80bebb7

Please sign in to comment.