'Camunda tests stop working after asyncBefore flag set to true for bpmn start event

Using tests from official Camunda Github repo: https://github.com/camunda/camunda-bpm-assert

examples folder contains a few bpmn files and tests, by default all works fine, all tests successfully passed, but when I set flag Asynchronous Before for Start event for any bpmn - all asserts start failing.

What is the right way to write tests when bpmn start event executed in async fashion?



Solution 1:[1]

To avoid that automatic background threads spoil your test control, the jobExecutor is normally turned off in unit tests.

If you have an async continuation, you will have to execute the job manually by running execute(job()) after starting the process.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jan Galinski