- I use the Camunda Spring Boot Starter with @EnableProcessApplication to use processes.xml for deployment
- I write a test as follows
- Spring's test runner caches application context's by default grouped by test configuration. Under the assumption that a test has no side-effects (read: does not modify the application context or any embedded resources), the context can be safely reused in another test if the test has the exact same configuration. This speeds up test runtime.
- When using context caching and there is more than one application context (e.g. because we have tests that use two different configurations; however the process engine configuration is the same), then the creation of the second context fails
- The problem is that we then have two process engines with the same name at the same time. The second SpringBootProcessApplication bean tries to register its engine with the MBean container and an exception is raised.
- In consequence, users must avoid to have multiple engines with the same name (e.g. by avoiding that there are two application contexts at the same time via @DirtiesContext or by ensuring unique engine names (which does not work well with processes.xml))