mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
DS-3787 add tests to show the bug
This commit is contained in:
@@ -359,6 +359,50 @@ public class BitstreamRestRepositoryIT extends AbstractControllerIntegrationTest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findOneLogoBitstreamTest() throws Exception {
|
||||||
|
|
||||||
|
// We turn off the authorization system in order to create the structure as defined below
|
||||||
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
|
// ** GIVEN **
|
||||||
|
// 1. A community with a logo
|
||||||
|
parentCommunity = CommunityBuilder.createCommunity(context).withName("Community").withLogo("logo_community")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 2. A collection with a logo
|
||||||
|
Collection col = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection")
|
||||||
|
.withLogo("logo_collection").build();
|
||||||
|
|
||||||
|
getClient().perform(get("/api/core/bitstreams/" + parentCommunity.getLogo().getID()))
|
||||||
|
.andExpect(status().isOk());
|
||||||
|
|
||||||
|
getClient().perform(get("/api/core/bitstreams/" + col.getLogo().getID())).andExpect(status().isOk());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findOneLogoBitstreamRelsTest() throws Exception {
|
||||||
|
|
||||||
|
// We turn off the authorization system in order to create the structure as defined below
|
||||||
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
|
// ** GIVEN **
|
||||||
|
// 1. A community with a logo
|
||||||
|
parentCommunity = CommunityBuilder.createCommunity(context).withName("Community").withLogo("logo_community")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 2. A collection with a logo
|
||||||
|
Collection col = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection")
|
||||||
|
.withLogo("logo_collection").build();
|
||||||
|
|
||||||
|
getClient().perform(get("/api/core/bitstreams/" + parentCommunity.getLogo().getID() + "/content"))
|
||||||
|
.andExpect(status().isOk()).andExpect(content().string("logo_community"));
|
||||||
|
|
||||||
|
getClient().perform(get("/api/core/bitstreams/" + col.getLogo().getID() + "/content"))
|
||||||
|
.andExpect(status().isOk()).andExpect(content().string("logo_collection"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void findOneWrongUUID() throws Exception {
|
public void findOneWrongUUID() throws Exception {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user