mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Fixed missing @Test on ITs
Modified CommunityMatcher to use the generic CommunityMetadataMatcher
This commit is contained in:
@@ -36,6 +36,7 @@ import org.junit.Test;
|
||||
|
||||
public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void createTest() throws Exception {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
@@ -101,6 +102,7 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createUnauthorizedTest() throws Exception {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
@@ -119,7 +121,7 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
getClient().perform(post("/api/core/communities")
|
||||
.content(mapper.writeValueAsBytes(comm))
|
||||
.contentType(contentType))
|
||||
.andExpect(status().isForbidden());
|
||||
.andExpect(status().isUnauthorized());
|
||||
|
||||
// Non-admin Eperson tries to create a community.
|
||||
// Should fail because user doesn't have permissions. Error 403.
|
||||
|
@@ -37,7 +37,7 @@ public class CommunityMatcher {
|
||||
hasJsonPath("$.handle", is(handle)),
|
||||
hasJsonPath("$.type", is("community")),
|
||||
hasJsonPath("$.metadata", Matchers.contains(
|
||||
CommunityMetadataMatcher.matchTitle(name)
|
||||
CommunityMetadataMatcher.matchMetadata("dc.title", name)
|
||||
))
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user