mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
108915: Fixed tests using incorrect route to access the communities endpoint
This commit is contained in:
@@ -331,21 +331,21 @@ public class SubResourcePermissionsIT extends AbstractControllerIntegrationTest
|
|||||||
|
|
||||||
// Calling public parentCommunity as an admin user
|
// Calling public parentCommunity as an admin user
|
||||||
// Should succeed
|
// Should succeed
|
||||||
getClient(adminToken).perform(get("/api/core/community/" + parentCommunity.getID()))
|
getClient(adminToken).perform(get("/api/core/communities/" + parentCommunity.getID()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$", CommunityMatcher
|
.andExpect(jsonPath("$", CommunityMatcher
|
||||||
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
||||||
|
|
||||||
// Calling public parentCommunity as a normal EPerson
|
// Calling public parentCommunity as a normal EPerson
|
||||||
// Should succeed
|
// Should succeed
|
||||||
getClient(epersonToken).perform(get("/api/core/community/" + parentCommunity.getID()))
|
getClient(epersonToken).perform(get("/api/core/communities/" + parentCommunity.getID()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$", CommunityMatcher
|
.andExpect(jsonPath("$", CommunityMatcher
|
||||||
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
||||||
|
|
||||||
// Calling public parentCommunity as an anon user
|
// Calling public parentCommunity as an anon user
|
||||||
// Should succeed
|
// Should succeed
|
||||||
getClient().perform(get("/api/core/community/" + parentCommunity.getID()))
|
getClient().perform(get("/api/core/communities/" + parentCommunity.getID()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$", CommunityMatcher
|
.andExpect(jsonPath("$", CommunityMatcher
|
||||||
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
||||||
@@ -404,19 +404,19 @@ public class SubResourcePermissionsIT extends AbstractControllerIntegrationTest
|
|||||||
|
|
||||||
// Calling private parentCommunity as an admin user
|
// Calling private parentCommunity as an admin user
|
||||||
// Should succeed
|
// Should succeed
|
||||||
getClient(adminToken).perform(get("/api/core/community/" + parentCommunity.getID()))
|
getClient(adminToken).perform(get("/api/core/communities/" + parentCommunity.getID()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$", CommunityMatcher
|
.andExpect(jsonPath("$", CommunityMatcher
|
||||||
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
.matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle())));
|
||||||
|
|
||||||
// Calling private parentCommunity as a normal EPerson
|
// Calling private parentCommunity as a normal EPerson
|
||||||
// Shouldn't succeed
|
// Shouldn't succeed
|
||||||
getClient(epersonToken).perform(get("/api/core/community/" + parentCommunity.getID()))
|
getClient(epersonToken).perform(get("/api/core/communities/" + parentCommunity.getID()))
|
||||||
.andExpect(status().isForbidden());
|
.andExpect(status().isForbidden());
|
||||||
|
|
||||||
// Calling private parentCommunity as an anon user
|
// Calling private parentCommunity as an anon user
|
||||||
// Shouldn't succeed
|
// Shouldn't succeed
|
||||||
getClient().perform(get("/api/core/community/" + parentCommunity.getID()))
|
getClient().perform(get("/api/core/communities/" + parentCommunity.getID()))
|
||||||
.andExpect(status().isUnauthorized());
|
.andExpect(status().isUnauthorized());
|
||||||
|
|
||||||
// Calling fullProjection, as an admin user, of a private Collection should contain the parentCommunity
|
// Calling fullProjection, as an admin user, of a private Collection should contain the parentCommunity
|
||||||
|
Reference in New Issue
Block a user