After completing a single user task, my test process completes an initial call activity subprocess. A single user task follows the call activity execution. My camunda-bpm-assert test case is failing asserting this user task. I just started trying to use camunda-bpm-assert so I am probably making some basic mistake.
The assertion that is failing with the message:
The assertion is failing at line # 33 in my code:
and my process and subprocess respectively are:
and
Any hints to get me going again would be much appreciated.
Thanks!
@Chuck_Irvine the reason the assertion is failing is the effect of your testing actually starting three process instances and not two as you would expect.
My assumption is that you haven’t configured any additional asynchronous continuations in your models.
When you have a call activity in your process, Camunda will take care of starting the subprocess from its binding. In your test setup, however, you are starting both an instance of the main and the sub process. You complete the user task in the sub process, and then you expect the main process to have progressed. But the sub process for which you have completed the task is not the one that is actually a sub process of the main process. You have created a completely standalone sub process and completed it. The one that does belong to the main process, was created as part of the call on line 23 in your test and is still patiently waiting there for the user task of the sub process to be completed.
So to fix this, you should delete lines 24 and 25 from your test and you need to get hold of the sub process instance that is created in the call activity of the main process before you can perform assertions on that instance and complete tasks. One way to do that is with the assertion framework by asserting on a process instance that you retrieve based on the bpmn key of the sub process’ model.
Hello @tiesebarrell. Originally, I was doing something along the lines of what you suggest, but I hit other snags that put me hopelessly down the wrong path that you point out. I now have a working test case shown below. Thanks for your help!
1 Like
That’s a good reminder to that .calledProcessInstance
method, too