Skip to content

Commit

Permalink
Fix CollectionAdminFeatureIT tests which have random failures caused …
Browse files Browse the repository at this point in the history
…by pagination. Added "feature" filter to tests to ensure we search for the one feature we are interested in.
  • Loading branch information
tdonohue committed Apr 18, 2024
1 parent 04df3b8 commit 60fc637
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,10 @@ public void testSubGroupOfAdminGroup() throws Exception {
String token = getAuthToken(eperson.getEmail(), password);

// Verify an ePerson in a subgroup of the site administrators has this feature
// Filter by "feature" ID because Admins may have >20 features enabled & cause this endpoint to paginate.
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()
+ "&feature=isCollectionAdmin"))
.andExpect(status().isOk())
.andExpect(
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]")
Expand Down Expand Up @@ -284,8 +286,10 @@ public void testSubSubGroupOfAdminGroup() throws Exception {
String token = getAuthToken(eperson.getEmail(), password);

// Verify an ePerson in a sub-subgroup of the site administrators has this feature
// Filter by "feature" ID because Admins may have >20 features enabled & cause this endpoint to paginate.
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()
+ "&feature=isCollectionAdmin"))
.andExpect(status().isOk())
.andExpect(
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]")
Expand Down

0 comments on commit 60fc637

Please sign in to comment.