mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
74236: Remove obsolete bean and IT test
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
<ref bean="openAccess"/>
|
||||
<ref bean="lease"/>
|
||||
<ref bean="embargoed" />
|
||||
<ref bean="embargoedWithGroupSelect" />
|
||||
<ref bean="administrator"/>
|
||||
<!-- <ref bean="networkAdministration"/> -->
|
||||
</list>
|
||||
@@ -39,13 +38,6 @@
|
||||
<property name="hasStartDate" value="true"/>
|
||||
<property name="startDateLimit" value="+36MONTHS"/>
|
||||
<property name="hasEndDate" value="false"/>
|
||||
|
||||
</bean>
|
||||
<bean id="embargoedWithGroupSelect" class="org.dspace.submit.model.AccessConditionOption">
|
||||
<property name="name" value="embargo"/>
|
||||
<property name="hasStartDate" value="true"/>
|
||||
<property name="startDateLimit" value="+36MONTHS"/>
|
||||
<property name="hasEndDate" value="false"/>
|
||||
</bean>
|
||||
<bean id="administrator" class="org.dspace.submit.model.AccessConditionOption">
|
||||
<property name="groupName" value="Administrator"/>
|
||||
|
@@ -3280,66 +3280,6 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
||||
;
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void patchUploadAddAccessConditionTest() throws Exception {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
parentCommunity = CommunityBuilder.createCommunity(context)
|
||||
.withName("Parent Community")
|
||||
.build();
|
||||
|
||||
Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity)
|
||||
.withName("Sub Community")
|
||||
.build();
|
||||
|
||||
Collection collection1 = CollectionBuilder.createCollection(context, child1)
|
||||
.withName("Collection 1")
|
||||
.build();
|
||||
|
||||
InputStream pdf = getClass().getResourceAsStream("simple-article.pdf");
|
||||
|
||||
WorkspaceItem witem = WorkspaceItemBuilder.createWorkspaceItem(context, collection1)
|
||||
.withTitle("Test WorkspaceItem")
|
||||
.withIssueDate("2019-10-01")
|
||||
.withFulltext("simple-article.pdf", "/local/path/simple-article.pdf", pdf)
|
||||
.build();
|
||||
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
// create a list of values to use in add accessCondition
|
||||
List<Operation> addAccessCondition = new ArrayList<Operation>();
|
||||
Map<String, String> value = new HashMap<String, String>();
|
||||
value.put("name", "embargoedWithGroupSelect");
|
||||
value.put("groupUUID", embargoedGroup1.getID().toString());
|
||||
value.put("endDate", "2030-10-02");
|
||||
addAccessCondition.add(new AddOperation("/sections/upload/files/0/accessConditions/-", value));
|
||||
|
||||
String patchBody = getPatchContent(addAccessCondition);
|
||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
||||
|
||||
getClient(authToken).perform(patch("/api/submission/workspaceitems/" + witem.getID())
|
||||
.content(patchBody)
|
||||
.contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$",Matchers.allOf(
|
||||
hasJsonPath("$.sections.upload.files[0].accessConditions[0].name",
|
||||
is("embargoedWithGroupSelect")),
|
||||
hasJsonPath("$.sections.upload.files[0].accessConditions[0].groupUUID",
|
||||
is(embargoedGroup1.getID().toString()))
|
||||
)));
|
||||
|
||||
// verify that the patch changes have been persisted
|
||||
getClient(authToken).perform(get("/api/submission/workspaceitems/" + witem.getID()))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$",Matchers.allOf(
|
||||
hasJsonPath("$.sections.upload.files[0].accessConditions[0].name",
|
||||
is("embargoedWithGroupSelect")),
|
||||
hasJsonPath("$.sections.upload.files[0].accessConditions[0].groupUUID",
|
||||
is(embargoedGroup1.getID().toString()))
|
||||
)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void patchUploadRemoveAccessConditionTest() throws Exception {
|
||||
|
Reference in New Issue
Block a user