AnsweredAssumed Answered

testing serviceTasks in the workflow

Question asked by lawandco on Jul 10, 2014
Latest reply on Jul 11, 2014 by martin.grofcik
I think I am missing some functional concepts in what I need to know to properly unit test my activiti workflow.
The workflow is like this:
userTask 1 -> serviceTask 1 -> exclusive gateway 1 -> userTask 2 -> exclusive gateway 2 -> serviceTask 2 -> end
decisions at either exclusive gateway could cause the process to end
the test at userTask 1 executes properly
build output shows the serviceTask 1 class is automatically executed.  serviceTask 1 is designed to make calls to resources that are not functional except in a production environment.  That is all stubbed out so that in the current environment it is always successful.
gateway 1 depends on a variable set by serviceTask 1. 
the test for userTask 2 runs until it performs a task.getName() and finds out the task is at userTask 1 not UserTask 2.
Tests never run in the correct order, which I believe is within the rules.
the first user task completed with activitiRule.getTaskService().complete(task.getId(), variables);
Question.  How does the serviceTask1 show activiti that it has completed successfully?
Question.  Why does the serviceTask 1 class automatically execute, since there is no serviceTask test written for it ( which is because I automatically see it execute )  Must I have a test for the serviceTask1 to make this work?