mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[DS-3762] implemented changes
This commit is contained in:
@@ -73,11 +73,20 @@ public class BitstreamFormatRestRepositoryIT extends AbstractControllerIntegrati
|
||||
@Test
|
||||
@Ignore
|
||||
public void findOne() throws Exception {
|
||||
getClient().perform(get("/api/core/bitstreamformats/1"))
|
||||
context.turnOffAuthorisationSystem();
|
||||
BitstreamFormat bitstreamFormat = BitstreamFormatBuilder.createBitstreamFormat(context)
|
||||
.withMimeType("application/octet-stream")
|
||||
.withDescription("Description")
|
||||
.build();
|
||||
|
||||
getClient().perform(get("/api/core/bitstreamformats/" + bitstreamFormat.getID()))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$.description", is(bitstreamFormat.getDescription())))
|
||||
.andExpect(jsonPath("$.mimetype", is(bitstreamFormat.getMIMEType())))
|
||||
.andExpect(jsonPath("$.type", is("bitstreamformat")))
|
||||
.andExpect(jsonPath("$._links.self.href", startsWith(REST_SERVER_URL)))
|
||||
.andExpect(jsonPath("$._links.self.href", endsWith("/api/core/bitstreamformats/1")))
|
||||
.andExpect(jsonPath("$._links.self.href", endsWith("/api/core/bitstreamformats/"+bitstreamFormat.getID())))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@@ -231,7 +231,6 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
|
||||
//TODO The test fails, 404 resource not found. remove @Ignore when this is implemented
|
||||
@Test
|
||||
@Ignore
|
||||
public void findAllSubCommunities() throws Exception{
|
||||
|
||||
//We turn off the authorization system in order to create the structure as defined below
|
||||
@@ -263,17 +262,17 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
|
||||
Collection col1 = CollectionBuilder.createCollection(context, child1).withName("Collection 1").build();
|
||||
|
||||
getClient().perform(get("/api/core/communities/search/subCommunities"))
|
||||
getClient().perform(get("/api/core/communities/search/subCommunities/" + parentCommunity.getID()))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.communities", Matchers.containsInAnyOrder(
|
||||
CommunityMatcher.matchCommunityEntry(child1.getName(), child1.getID(), child1.getHandle()),
|
||||
CommunityMatcher.matchCommunityEntry(child12.getName(), child12.getID(), child12.getHandle()),
|
||||
CommunityMatcher.matchCommunityEntry(child2.getName(), child2.getID(), child2.getHandle())
|
||||
CommunityMatcher.matchCommunityEntry(child12.getName(), child12.getID(), child12.getHandle())
|
||||
)))
|
||||
.andExpect(jsonPath("$._embedded.communities", Matchers.not(Matchers.containsInAnyOrder(
|
||||
CommunityMatcher.matchCommunityEntry(parentCommunity.getName(), parentCommunity.getID(), parentCommunity.getHandle()),
|
||||
CommunityMatcher.matchCommunityEntry(parentCommunity2.getName(), parentCommunity2.getID(), parentCommunity2.getHandle())
|
||||
CommunityMatcher.matchCommunityEntry(parentCommunity2.getName(), parentCommunity2.getID(), parentCommunity2.getHandle()),
|
||||
CommunityMatcher.matchCommunityEntry(child2.getName(), child2.getID(), child2.getHandle())
|
||||
))))
|
||||
.andExpect(jsonPath("$._links.self.href", Matchers.containsString("/api/core/communities/search/subCommunities")))
|
||||
.andExpect(jsonPath("$.page.size", is(20)))
|
||||
|
Reference in New Issue
Block a user