BpmnParseListener not invoked when restart (or create a new) camunda7Run docker/TestContainer

Dear Sir,

My issue is similar to post Camunda Restart. But in that post there is no solution provided. So I post my issue here.

I write a new plugin and in which a new BpmnParseListener is registered. In unit test, a TestContainer/Docker using “camunda/camunda-bpm-platform:run-7.22.0-alpha5” (referred as ‘camunda7RunTestContainer’ later) and a PostgreSQLContainer is used. A bpmn file is deployed through org.camunda.community.rest.client.invoker.ApiClient.

The unit test works well when using only one instance of ‘camunda7RunTestContainer’.

But, if use one instance of ‘camunda7RunTestContainer’ to deploy bpmn file and then stop the instance and create a new instance of ‘camunda7RunTestContainer’ to connect to the same PostgreSQLContainer, the BpmnParseListener in the new instance of ‘camunda7RunTestContainer’ is not invoked, then unit test fail.

By logging ‘processEngineConfiguration.isJobExecutorDeploymentAware()’ in ‘Plugin.preInit(ProcessEngineConfigurationImpl processEngineConfiguration){}’, its value is ‘false’.

So, how to make BpmnParseListener in the new instance of ‘camunda7RunTestContainer’ (or a restarted instance) be invoked?