Camunda 8.9 CPT - mockChildProcess with Multitenancy

Hi, I’m using Camunda Process Test with Camunda 8.9. I have created several tests that work when multi-tenancy is not active.

When I enable multi-tenancy, the tests now fail where I am mocking child processes via processTestContext.mockChildProcess - my assumption is that this is due to the mocked child process not being ‘deployed’ to the tenant that the test instance is ran on.

My question is:

  1. Is this the right assumption or is there some other potential reason why it now fails at that point where it previously didn’t?

  2. If it’s likely due to the above, is there a way to fix this?

a) Maybe associate the mocked process with a tenant or the process test context with a tenant?

b) Or is this just a current limitation of mockChildProcess and I’d need to use the real process and deploy to the tenant?

Your assumption about tenant scoping appears correct - the documentation doesn’t specify how mockChildProcess behaves with multi-tenancy, and there’s no tenant parameter in the API. I found the following relevant resources:

Does this help? If not, can anyone from the community jump in? :waving_hand:


:light_bulb: Hints: Use the Ask AI feature in Camunda’s documentation to chat with AI and get fast help. Report bugs and features in Camuda’s GitHub issue tracker. Trust the process. :robot:

I asked the AI already and it gave the same answer, suggesting I post in the forums. If it’s not possible, what are the options / workarounds?

  • I assume there’s no way to set a tenant for ProcessTestContext
  • Is this just an actual limitation and the only workaround is to deploy the ‘real process’ to the tenant, even if it’s not fully developed? Surely this wouldn’t be the best option especially with multiple levels of child processes?

@markm thank you for reporting. :+1: You’re right, this is a limitation of CPT. You can’t mock a child process for a specific tenant. CPT deploys the mock using the default tenant.

Workaround: use the client and deploy a fake child process yourself for the tenant. The process needs only a start and an end event.

You can open a feature request on GitHub: Sign in to GitHub · GitHub .

I would like to learn more about your multi-tenancy use case. If possible, please share your test code and details about what you want to test exactly and how.