Fixing issues with the latest main merge

This commit is contained in:
Kevin Van de Velde
2021-02-03 13:07:21 +01:00
parent dbc0281771
commit 6e4a641ea5

View File

@@ -36,16 +36,16 @@ import org.dspace.discovery.indexobject.IndexableWorkspaceItem;
import org.dspace.eperson.EPerson; import org.dspace.eperson.EPerson;
import org.dspace.services.factory.DSpaceServicesFactory; import org.dspace.services.factory.DSpaceServicesFactory;
import org.dspace.workflow.WorkflowException; import org.dspace.workflow.WorkflowException;
import org.dspace.workflow.WorkflowItem;
import org.dspace.workflow.WorkflowService;
import org.dspace.workflow.factory.WorkflowServiceFactory;
import org.dspace.xmlworkflow.WorkflowConfigurationException; import org.dspace.xmlworkflow.WorkflowConfigurationException;
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
import org.dspace.xmlworkflow.service.WorkflowRequirementsService; import org.dspace.xmlworkflow.service.WorkflowRequirementsService;
import org.dspace.xmlworkflow.service.XmlWorkflowService;
import org.dspace.xmlworkflow.state.Step; import org.dspace.xmlworkflow.state.Step;
import org.dspace.xmlworkflow.state.Workflow; import org.dspace.xmlworkflow.state.Workflow;
import org.dspace.xmlworkflow.state.actions.WorkflowActionConfig; import org.dspace.xmlworkflow.state.actions.WorkflowActionConfig;
import org.dspace.xmlworkflow.storedcomponents.ClaimedTask; import org.dspace.xmlworkflow.storedcomponents.ClaimedTask;
import org.dspace.xmlworkflow.storedcomponents.PoolTask; import org.dspace.xmlworkflow.storedcomponents.PoolTask;
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
import org.dspace.xmlworkflow.storedcomponents.service.ClaimedTaskService; import org.dspace.xmlworkflow.storedcomponents.service.ClaimedTaskService;
import org.junit.Test; import org.junit.Test;
import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletRequest;
@@ -58,12 +58,12 @@ public class DiscoveryIT extends AbstractIntegrationTestWithDatabase {
protected WorkspaceItemService workspaceItemService = ContentServiceFactory.getInstance().getWorkspaceItemService(); protected WorkspaceItemService workspaceItemService = ContentServiceFactory.getInstance().getWorkspaceItemService();
protected SearchService searchService = SearchUtils.getSearchService(); protected SearchService searchService = SearchUtils.getSearchService();
XmlWorkflowService workflowService = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService(); WorkflowService workflowService = WorkflowServiceFactory.getInstance().getWorkflowService();
WorkflowRequirementsService workflowRequirementsService = XmlWorkflowServiceFactory.getInstance(). WorkflowRequirementsService workflowRequirementsService = WorkflowServiceFactory.getInstance().
getWorkflowRequirementsService(); getWorkflowRequirementsService();
ClaimedTaskService claimedTaskService = XmlWorkflowServiceFactory.getInstance().getClaimedTaskService(); ClaimedTaskService claimedTaskService = WorkflowServiceFactory.getInstance().getClaimedTaskService();
ItemService itemService = ContentServiceFactory.getInstance().getItemService(); ItemService itemService = ContentServiceFactory.getInstance().getItemService();
@@ -138,7 +138,7 @@ public class DiscoveryIT extends AbstractIntegrationTestWithDatabase {
Collection collection = CollectionBuilder.createCollection(context, community) Collection collection = CollectionBuilder.createCollection(context, community)
.withWorkflowGroup(1, admin) .withWorkflowGroup(1, admin)
.build(); .build();
Workflow workflow = XmlWorkflowServiceFactory.getInstance().getWorkflowFactory().getWorkflow(collection); Workflow workflow = WorkflowServiceFactory.getInstance().getWorkflowFactory().getWorkflow(collection);
ClaimedTask taskToApprove = ClaimedTaskBuilder.createClaimedTask(context, collection, admin) ClaimedTask taskToApprove = ClaimedTaskBuilder.createClaimedTask(context, collection, admin)
.withTitle("Test workflow item to approve") .withTitle("Test workflow item to approve")
@@ -160,7 +160,7 @@ public class DiscoveryIT extends AbstractIntegrationTestWithDatabase {
.withIssueDate("2019-03-06") .withIssueDate("2019-03-06")
.withSubject("ExtraEntry") .withSubject("ExtraEntry")
.build(); .build();
XmlWorkflowItem wfiToDelete = WorkflowItemBuilder.createWorkflowItem(context, collection) WorkflowItem wfiToDelete = WorkflowItemBuilder.createWorkflowItem(context, collection)
.withTitle("Test workflow item to return") .withTitle("Test workflow item to return")
.withIssueDate("2019-03-06") .withIssueDate("2019-03-06")
.withSubject("ExtraEntry") .withSubject("ExtraEntry")
@@ -253,7 +253,7 @@ public class DiscoveryIT extends AbstractIntegrationTestWithDatabase {
throws SQLException, AuthorizeException, IOException, WorkflowException, SearchServiceException { throws SQLException, AuthorizeException, IOException, WorkflowException, SearchServiceException {
context.turnOffAuthorisationSystem(); context.turnOffAuthorisationSystem();
workspaceItem = context.reloadEntity(workspaceItem); workspaceItem = context.reloadEntity(workspaceItem);
XmlWorkflowItem workflowItem = workflowService.startWithoutNotify(context, workspaceItem); WorkflowItem workflowItem = workflowService.startWithoutNotify(context, workspaceItem);
context.commit(); context.commit();
indexer.commit(); indexer.commit();
context.restoreAuthSystemState(); context.restoreAuthSystemState();
@@ -269,7 +269,7 @@ public class DiscoveryIT extends AbstractIntegrationTestWithDatabase {
context.restoreAuthSystemState(); context.restoreAuthSystemState();
} }
private void deleteWorkflowItem(XmlWorkflowItem workflowItem) private void deleteWorkflowItem(WorkflowItem workflowItem)
throws SQLException, AuthorizeException, IOException, SearchServiceException { throws SQLException, AuthorizeException, IOException, SearchServiceException {
context.turnOffAuthorisationSystem(); context.turnOffAuthorisationSystem();
workflowItem = context.reloadEntity(workflowItem); workflowItem = context.reloadEntity(workflowItem);
@@ -284,7 +284,7 @@ public class DiscoveryIT extends AbstractIntegrationTestWithDatabase {
final EPerson previousUser = context.getCurrentUser(); final EPerson previousUser = context.getCurrentUser();
taskToUnclaim = context.reloadEntity(taskToUnclaim); taskToUnclaim = context.reloadEntity(taskToUnclaim);
context.setCurrentUser(taskToUnclaim.getOwner()); context.setCurrentUser(taskToUnclaim.getOwner());
XmlWorkflowItem workflowItem = taskToUnclaim.getWorkflowItem(); WorkflowItem workflowItem = taskToUnclaim.getWorkflowItem();
workflowService.deleteClaimedTask(context, workflowItem, taskToUnclaim); workflowService.deleteClaimedTask(context, workflowItem, taskToUnclaim);
workflowRequirementsService.removeClaimedUser(context, workflowItem, taskToUnclaim.getOwner(), workflowRequirementsService.removeClaimedUser(context, workflowItem, taskToUnclaim.getOwner(),
taskToUnclaim.getStepID()); taskToUnclaim.getStepID());
@@ -318,7 +318,7 @@ public class DiscoveryIT extends AbstractIntegrationTestWithDatabase {
context.setCurrentUser(previousUser); context.setCurrentUser(previousUser);
} }
private void abort(XmlWorkflowItem workflowItem) private void abort(WorkflowItem workflowItem)
throws SQLException, AuthorizeException, IOException, SearchServiceException { throws SQLException, AuthorizeException, IOException, SearchServiceException {
final EPerson previousUser = context.getCurrentUser(); final EPerson previousUser = context.getCurrentUser();
workflowItem = context.reloadEntity(workflowItem); workflowItem = context.reloadEntity(workflowItem);