Skip to content

Commit

Permalink
Load metadata file for workflow controller service IT dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Dec 11, 2023
1 parent 7136ff5 commit 8b12c9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.production.services.ServiceManager;
import org.kitodo.production.services.data.ProcessService;
import org.kitodo.production.services.data.TaskService;
import org.kitodo.production.services.file.FileService;
import org.kitodo.utils.ProcessTestUtils;
Expand All @@ -61,6 +60,8 @@ public class WorkflowControllerServiceIT {
private static final TaskService taskService = ServiceManager.getTaskService();
private static final WorkflowControllerService workflowService = new WorkflowControllerService();
private static int workflowTestProcessId = -1;
private static int workflowTestProcessId2 = -1;
private static final String METADATA_TEST_FILENAME = "testMetadataForNonBlockingParallelTasksTest.xml";

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

usersDirectory.mkdir();

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

@After
public void cleanDatabase() throws Exception {
ProcessService.deleteProcess(workflowTestProcessId);
ProcessTestUtils.removeTestProcess(workflowTestProcessId);
ProcessTestUtils.removeTestProcess(workflowTestProcessId2);
MockDatabase.stopNode();
MockDatabase.cleanDatabase();
SecurityTestUtils.cleanSecurityContext();
Expand Down

0 comments on commit 8b12c9f

Please sign in to comment.