mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
added test to prove pagination bug
This commit is contained in:
@@ -288,4 +288,38 @@ public class RelationshipTypeRestRepositoryIT extends AbstractEntityIntegrationT
|
|||||||
.andExpect(status().isBadRequest());
|
.andExpect(status().isBadRequest());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findByEntityTypePublicationPaginationTest() throws Exception {
|
||||||
|
getClient().perform(get("/api/core/relationshiptypes/search/byEntityType")
|
||||||
|
.param("type", "Publication")
|
||||||
|
.param("size", "3"))
|
||||||
|
.andExpect(status().isOk())
|
||||||
|
.andExpect(jsonPath("$._embedded.relationshiptypes", containsInAnyOrder(
|
||||||
|
RelationshipTypeMatcher.matchExplicitRestrictedRelationshipTypeValues(
|
||||||
|
"isAuthorOfPublication", "isPublicationOfAuthor"),
|
||||||
|
RelationshipTypeMatcher.matchExplicitRestrictedRelationshipTypeValues(
|
||||||
|
"isProjectOfPublication", "isPublicationOfProject"),
|
||||||
|
RelationshipTypeMatcher.matchExplicitRestrictedRelationshipTypeValues(
|
||||||
|
"isOrgUnitOfPublication", "isPublicationOfOrgUnit")
|
||||||
|
)))
|
||||||
|
.andExpect(jsonPath("$.page.number", is(0)))
|
||||||
|
.andExpect(jsonPath("$.page.totalPages", is(2)))
|
||||||
|
.andExpect(jsonPath("$.page.totalElements", is(5)));
|
||||||
|
|
||||||
|
getClient().perform(get("/api/core/relationshiptypes/search/byEntityType")
|
||||||
|
.param("type", "Publication")
|
||||||
|
.param("page", "1")
|
||||||
|
.param("size", "3"))
|
||||||
|
.andExpect(status().isOk())
|
||||||
|
.andExpect(jsonPath("$._embedded.relationshiptypes", containsInAnyOrder(
|
||||||
|
RelationshipTypeMatcher.matchExplicitRestrictedRelationshipTypeValues(
|
||||||
|
"isAuthorOfPublication", "isPublicationOfAuthor"),
|
||||||
|
RelationshipTypeMatcher.matchExplicitRestrictedRelationshipTypeValues(
|
||||||
|
"isPublicationOfJournalIssue", "isJournalIssueOfPublication")
|
||||||
|
)))
|
||||||
|
.andExpect(jsonPath("$.page.number", is(1)))
|
||||||
|
.andExpect(jsonPath("$.page.totalPages", is(2)))
|
||||||
|
.andExpect(jsonPath("$.page.totalElements", is(5)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user