mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 13:03:11 +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 {
|
public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
public void createTest() throws Exception {
|
public void createTest() throws Exception {
|
||||||
context.turnOffAuthorisationSystem();
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
@@ -101,6 +102,7 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void createUnauthorizedTest() throws Exception {
|
public void createUnauthorizedTest() throws Exception {
|
||||||
context.turnOffAuthorisationSystem();
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
@@ -119,7 +121,7 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
|
|||||||
getClient().perform(post("/api/core/communities")
|
getClient().perform(post("/api/core/communities")
|
||||||
.content(mapper.writeValueAsBytes(comm))
|
.content(mapper.writeValueAsBytes(comm))
|
||||||
.contentType(contentType))
|
.contentType(contentType))
|
||||||
.andExpect(status().isForbidden());
|
.andExpect(status().isUnauthorized());
|
||||||
|
|
||||||
// Non-admin Eperson tries to create a community.
|
// Non-admin Eperson tries to create a community.
|
||||||
// Should fail because user doesn't have permissions. Error 403.
|
// Should fail because user doesn't have permissions. Error 403.
|
||||||
|
@@ -37,7 +37,7 @@ public class CommunityMatcher {
|
|||||||
hasJsonPath("$.handle", is(handle)),
|
hasJsonPath("$.handle", is(handle)),
|
||||||
hasJsonPath("$.type", is("community")),
|
hasJsonPath("$.type", is("community")),
|
||||||
hasJsonPath("$.metadata", Matchers.contains(
|
hasJsonPath("$.metadata", Matchers.contains(
|
||||||
CommunityMetadataMatcher.matchTitle(name)
|
CommunityMetadataMatcher.matchMetadata("dc.title", name)
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user