Disable Async on Tests

Hi everybody…

Is there any way I could globally turn off async behaviour when testing (spring boot test) my process ?

For example, suppose I have a task that I decided to set asynchronous before/after on. It makes a lot of sense when on production but when testing it would be much better to have control of its execution.

To illustrate the problem: when raise an exception in a delegate of an before-async task, the test won’t fail.

You can disable the jobexecutor in you test configuration and manually execute the jobs during testing.

Might make sense to check out Scenario Tests, too:

Hi @jangalinski, thanks for you reply…

Although I might work, I really don’t think triggering jobs manually is the best approach. It’s too verbose, too much error prone and not quite efficient since can easily forget to execute the jobs.

Again, I think it may be used but I don’t think it’s good enough to be considered a good solution…

You could check out https://github.com/camunda/camunda-bpm-assert-scenario which allows a-priori definition of what should happen. Haven’t tried it myself, though.