Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lincmba committed Jul 30, 2024
1 parent 6fe6d4d commit a39f59a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,18 @@ public void testGetDescendantsWithAdminLevelFiltersReturnsLocationsWithinAdminLe
verify(queryMock, times(2)).execute();
}

@Test
public void testFilterLocationsByAdminLevelsBasic() {
List<Location> locations = createLocationList(5, true);
List<String> adminLevels = List.of("1", "3");

List<Location> filteredLocations = locationHierarchyEndpointHelper.filterLocationsByAdminLevels(locations, adminLevels);

Assert.assertEquals(2, filteredLocations.size());
Assert.assertEquals("1", filteredLocations.get(0).getId());
Assert.assertEquals("3", filteredLocations.get(1).getId());
}

private Bundle getLocationBundle() {
Bundle bundleLocation = new Bundle();
bundleLocation.setId("Location/1234");
Expand Down

0 comments on commit a39f59a

Please sign in to comment.