How to run integration tests for BPMNs that include service task (workers) #149
Unanswered
seattle-classmate
asked this question in
Q&A
Replies: 1 comment
-
Can you share your code? In general, you could start your job worker inside the test case using the provided Zeebe client. If you're using Spring, check the spring-zeebe documentation here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My team is using Camunda 8 in production and we are planning to add integration tests.
We want to achieve the following integration test functionality:
I am using
zeebe-process-test-extension
maven dependency to spin up an embedded zeebe engine i.e. @ZeebeProcessTest and its assertionsThe BPMN to be tested has a service task that queries a documentdb datastore that is running in docker.
I added this code to bootstrap the worker -
final var activateJobsResponse = zeebeClient.newActivateJobsCommand().jobType(jobType).maxJobsToActivate(count).send().join();
and passed in the jobType as per the worker implementation in src/main/java folder.
After running the test, the embedded zeebe engine comes up fine, the BPMN gets deployed correctly and the process instance starts but instead of trigger the above mentioned worker implementation, it triggers a new worker and asserts the output of the BPMN to false.
Which means, it did not pick the correct worker instead ran a new worker of the same jobType.
How can I resolve this and make sure the test picks the worker inside src/main/java folder?
Note - I do not want to mock the worker implementation
Beta Was this translation helpful? Give feedback.
All reactions