Skip to content

Commit

Permalink
115434: Added test proving that different values for relatedEntityTyp…
Browse files Browse the repository at this point in the history
…e return different results

(cherry picked from commit bbae1fb)
  • Loading branch information
alexandrevryghem authored and github-actions[bot] committed Jun 7, 2024
1 parent 8d82457 commit 7789304
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,22 @@ public void findRelationshipByLabelWithRelatedEntityTypeTest() throws Exception
RelationshipMatcher.matchRelationship(relationship1)
)))
;

// Perform a GET request to the searchByLabel endpoint, asking for Relationships of type isAuthorOfPublication
// With an extra parameter namely DSO which resolves to the publication used by both relationships.
// Only the OrgUnit relationship should be returned if we specify the DSO's related entity type
getClient().perform(get("/api/core/relationships/search/byLabel")
.param("label", "isAuthorOfPublication")
.param("dso", publication1.getID().toString())
.param("relatedEntityType", "OrgUnit")
.param("projection", "full"))

.andExpect(status().isOk())
.andExpect(jsonPath("$.page", is(PageMatcher.pageEntryWithTotalPagesAndElements(0, 20, 1, 1))))
.andExpect(jsonPath("$._embedded.relationships", containsInAnyOrder(
RelationshipMatcher.matchRelationship(relationship2)
)))
;
}

@Test
Expand Down

0 comments on commit 7789304

Please sign in to comment.