Camunda Platform Scenario tests and async before/after

I start using Camunda Platform Scenario to test my process (embedded Camunda in SpringBoot). I have built some scenario tests that run successfully.

However as soon as I enable “async before” (or after, tried both) on my process start event, the tests fail on the execute call.

Scenario handler = Scenario.run(scenario).startByKey(...).execute();

The error is: ENGINE-14026 No job found with id ‘43dbd290-ed57-11ec-a48e-0a0027000002’

First this seemed obvious to me, since the JobExecutor is not running. But then I saw in the log that the process is executed. That also matches the quote from the Platform Scenario project github page

Introduce or remove transaction borders (“savepoints”: asyncBefore/asyncAfter) without affecting your tests

2022-06-16 11:32:39.877 DEBUG 17136 --- [aTaskExecutor-1] c.v.l.t.p.service....
2022-06-16 11:32:39.883 DEBUG 17136 --- [aTaskExecutor-1] c.v.l.t.p.service....

It looks to me like the process is running and completed successfully, but because of the async flag the Scenario test has “lost” the execution

Am I missing something?

Thanks
Stephan

Hi,

I’m with a same problem, did you have any solution?

Hi

I just looked at my tests. They are running and the asyncBefore flag is set on the start event of the process. So it seems to work now (I wrote the post above almost a year ago).

But to be honest: I can’t remember what the problem finally was and how I solved it. Just a wild guess: I found this property in my test-configuration

camunda.bpm.job-execution.enabled: false

Hope it helps

Sorry
Stephan