cancel
Showing results for 
Search instead for 
Did you mean: 

unit testing of a complex process

tassoc1
Champ in-the-making
Champ in-the-making
Hi All,
I'm going to develop some unit tests using Activiti.
All of the unit tests I've seen so far make the process to start from the beginning.
Unfortunately, a process is often made up of several activities and gateways and I'd like to create a unit test which verifies the correct behavior of a single step of the workflow. So, is it possible to set the state of a process to an arbitrary value without completing the preceding tasks?
For example, consider a process which contains three user tasks (Start–>A–>B–>C–>END) and an unit-test which must verify only the correctness of the transition from user task B to C. Is it possible to create a process instance which has B as current activity and an a certain set of execution variables? I don't want to call "complete" on task A , of course.
Thanks in advance.

Claudio
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
No, unfortunately that is not possible with the current testing code.

However, I do agree it is something which is really useful to have. As a matter of fact, I remember doing the same thing years ago on jBPM 3 …

The tricky thing here is if you want history or not, how you provide the variables of the process, etc.
Would it be OK to have an 'auto-drive' through the process or do you really need to set the execution pointers directly to the stte you want (the latter might be tricky).

I forwarded this thread to the other devs … maybe they have some grand insight here.