@@ -171,6 +171,7 @@ public void shouldClose() throws Exception {
171
171
@ Test
172
172
public void shouldCloseForProcessWithParallelTasks () throws Exception {
173
173
Task task = taskService .getById (19 );
174
+ ProcessTestUtils .copyTestMetadataFile (task .getProcess ().getId (), ProcessTestUtils .testFileChildProcessToKeep );
174
175
175
176
workflowService .close (task );
176
177
assertEquals ("Task '" + task .getTitle () + "' was not closed!" , TaskStatus .DONE , task .getProcessingStatus ());
@@ -193,11 +194,14 @@ public void shouldCloseForProcessWithParallelTasks() throws Exception {
193
194
nextTask = taskService .getById (23 );
194
195
assertEquals ("Task '" + nextTask .getTitle () + "' was set up to open!" , TaskStatus .LOCKED ,
195
196
nextTask .getProcessingStatus ());
197
+
198
+ ProcessTestUtils .removeTestProcess (task .getProcess ().getId ());
196
199
}
197
200
198
201
@ Test
199
202
public void shouldCloseForInWorkProcessWithParallelTasks () throws Exception {
200
203
Task task = taskService .getById (25 );
204
+ ProcessTestUtils .copyTestMetadataFile (task .getProcess ().getId (), ProcessTestUtils .testFileChildProcessToKeep );
201
205
202
206
workflowService .close (task );
203
207
assertEquals ("Task '" + task .getTitle () + "' was not closed!" , TaskStatus .DONE , task .getProcessingStatus ());
@@ -215,6 +219,7 @@ public void shouldCloseForInWorkProcessWithParallelTasks() throws Exception {
215
219
nextTask = taskService .getById (28 );
216
220
assertEquals ("Task '" + nextTask .getTitle () + "' was set up to open!" , TaskStatus .LOCKED ,
217
221
nextTask .getProcessingStatus ());
222
+ ProcessTestUtils .removeTestProcess (task .getProcess ().getId ());
218
223
}
219
224
220
225
@ Test
@@ -342,9 +347,10 @@ public void shouldCloseForProcessWithScriptParallelTasks() throws Exception {
342
347
343
348
@ Test
344
349
public void shouldCloseForProcessWithSkippedTask () throws DataException , DAOException , IOException {
345
- Process process = new Process ();
346
- process .setProcessBaseUri (URI .create ("4" ));
347
- ServiceManager .getProcessService ().save (process );
350
+ int processId = MockDatabase .insertTestProcess ("Test process" , 1 , 1 , 1 );
351
+ Process process = ServiceManager .getProcessService ().getById (processId );
352
+ process .getTasks ().clear ();
353
+ ProcessTestUtils .copyTestMetadataFile (processId , ProcessTestUtils .testFileForHierarchyParent );
348
354
WorkflowCondition workflowCondition = new WorkflowCondition ("xpath" , "/mets:nothing" );
349
355
ServiceManager .getWorkflowConditionService ().saveToDatabase (workflowCondition );
350
356
Task taskToClose = createAndSaveTask (TaskStatus .INWORK , 1 , process , null );
@@ -380,7 +386,7 @@ public void shouldCloseForProcessWithSkippedTask() throws DataException, DAOExce
380
386
thirdTaskToSkip .getProcessingStatus ());
381
387
382
388
process .getTasks ().clear ();
383
- ServiceManager . getProcessService (). remove ( process );
389
+ ProcessTestUtils . removeTestProcess ( processId );
384
390
}
385
391
386
392
private Task createAndSaveTask (TaskStatus taskStatus , int ordering , Process process ,
0 commit comments