-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TE-584: Handle task from sub process
- Loading branch information
1 parent
a4ccbea
commit 641c1d5
Showing
10 changed files
with
509 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...nalyzer-test/src_test/com/axonivy/utils/process/analyzer/test/FlowSubProcessCaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.axonivy.utils.process.analyzer.test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertArrayEquals; | ||
|
||
import java.util.List; | ||
|
||
import org.assertj.core.util.Arrays; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import com.axonivy.utils.process.analyzer.internal.ProcessAnalyzer; | ||
|
||
import ch.ivyteam.ivy.bpm.engine.client.BpmClient; | ||
import ch.ivyteam.ivy.bpm.engine.client.ExecutionResult; | ||
import ch.ivyteam.ivy.bpm.engine.client.element.BpmProcess; | ||
import ch.ivyteam.ivy.bpm.exec.client.IvyProcessTest; | ||
import ch.ivyteam.ivy.workflow.ICase; | ||
import ch.ivyteam.ivy.workflow.ITask; | ||
|
||
@IvyProcessTest | ||
public class FlowSubProcessCaseTest extends FlowExampleTest { | ||
private static final BpmProcess FLOW_SUB_PROCESS = BpmProcess.name("FlowSubprocess"); | ||
|
||
@BeforeEach | ||
public void setupForEach() { | ||
processAnalyzer = new ProcessAnalyzer(); | ||
} | ||
|
||
@Test | ||
void shouldshouldFindAllTasksAtStart3(BpmClient bpmClient) throws Exception { | ||
ExecutionResult result = bpmClient.start().process(FLOW_SUB_PROCESS.elementName("start3")).execute(); | ||
ICase icase = result.workflow().activeCase(); | ||
|
||
List<ITask> parallelTasks = result.workflow().activeTasks(); | ||
|
||
var detectedTasks = processAnalyzer.findAllTasks(icase, null); | ||
|
||
var expected = Arrays.array("CallSubProcess A", "TaskC", "TaskB"); | ||
var taskNames = getTaskNames(detectedTasks); | ||
assertArrayEquals(expected, taskNames); | ||
} | ||
|
||
@Test | ||
void shouldshouldFindAllTasksAtStart(BpmClient bpmClient) throws Exception { | ||
ExecutionResult result = bpmClient.start().process(FLOW_SUB_PROCESS.elementName("start")).execute(); | ||
ICase icase = result.workflow().activeCase(); | ||
|
||
List<ITask> parallelTasks = result.workflow().activeTasks(); | ||
|
||
var detectedTasks = processAnalyzer.findAllTasks(icase, null); | ||
|
||
var expected = Arrays.array("Task A", "Task B"); | ||
var taskNames = getTaskNames(detectedTasks); | ||
assertArrayEquals(expected, taskNames); | ||
} | ||
} |
Oops, something went wrong.