Skip to content

Commit 8b12c9f

Browse files
committed
Load metadata file for workflow controller service IT dynamically
1 parent 7136ff5 commit 8b12c9f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Kitodo/src/test/java/org/kitodo/production/services/workflow/WorkflowControllerServiceIT.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.kitodo.data.database.exceptions.DAOException;
4444
import org.kitodo.data.exceptions.DataException;
4545
import org.kitodo.production.services.ServiceManager;
46-
import org.kitodo.production.services.data.ProcessService;
4746
import org.kitodo.production.services.data.TaskService;
4847
import org.kitodo.production.services.file.FileService;
4948
import org.kitodo.utils.ProcessTestUtils;
@@ -61,6 +60,8 @@ public class WorkflowControllerServiceIT {
6160
private static final TaskService taskService = ServiceManager.getTaskService();
6261
private static final WorkflowControllerService workflowService = new WorkflowControllerService();
6362
private static int workflowTestProcessId = -1;
63+
private static int workflowTestProcessId2 = -1;
64+
private static final String METADATA_TEST_FILENAME = "testMetadataForNonBlockingParallelTasksTest.xml";
6465

6566
@Before
6667
public void prepareDatabase() throws Exception {
@@ -69,6 +70,9 @@ public void prepareDatabase() throws Exception {
6970
workflowTestProcessId = Math.toIntExact(ServiceManager.getProcessService().count());
7071
ProcessTestUtils.copyTestFiles(workflowTestProcessId, "testmetaNewspaper.xml");
7172
SecurityTestUtils.addUserDataToSecurityContext(ServiceManager.getUserService().getById(1), 1);
73+
Task task = ServiceManager.getTaskService().getById(35);
74+
workflowTestProcessId2 = task.getProcess().getId();
75+
ProcessTestUtils.copyTestMetadataFile(workflowTestProcessId2, METADATA_TEST_FILENAME);
7276

7377
usersDirectory.mkdir();
7478

@@ -82,7 +86,8 @@ public void prepareDatabase() throws Exception {
8286

8387
@After
8488
public void cleanDatabase() throws Exception {
85-
ProcessService.deleteProcess(workflowTestProcessId);
89+
ProcessTestUtils.removeTestProcess(workflowTestProcessId);
90+
ProcessTestUtils.removeTestProcess(workflowTestProcessId2);
8691
MockDatabase.stopNode();
8792
MockDatabase.cleanDatabase();
8893
SecurityTestUtils.cleanSecurityContext();

0 commit comments

Comments
 (0)