I have a spring-boot application which makes use of camunda process and facing challenges in running JUnit Tests for camunda processes. Appreciate any help in fixing this.
The tests fail with below exception
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘testController’: Unsatisfied dependency expressed through field ‘testService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘testService’: Unsatisfied dependency expressed through field ‘processEngine’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.ProcessEngineException: The deployment contains definitions with the same key ‘HelloWorld’ (id attribute), this is not allowed
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘testService’: Unsatisfied dependency expressed through field ‘processEngine’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.ProcessEngineException: The deployment contains definitions with the same key ‘HelloWorld’ (id attribute), this is not allowed
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.ProcessEngineException: The deployment contains definitions with the same key ‘HelloWorld’ (id attribute), this is not allowed
Caused by: org.camunda.bpm.engine.ProcessEngineException: The deployment contains definitions with the same key ‘HelloWorld’ (id attribute), this is not allowed
I do not have multiple definitions of the HelloWorld bpmn in the workspace. I also do not have @EnableProcessApplication annotation on the spring boot application class (as adding it causes unlreated JUnit 5 tests to fail with “unable to load process engine” exception). I am assuming the ProcessEngine will be autowired in the absence of this annotation.