mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
115434: Added test proving that different values for relatedEntityType return different results
(cherry picked from commit bbae1fb0d1
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
8d82457eb7
commit
7789304ebe
@@ -2376,6 +2376,22 @@ public class RelationshipRestRepositoryIT extends AbstractEntityIntegrationTest
|
||||
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
|
||||
|
Reference in New Issue
Block a user