We are using Camunda Sprint boot micro-service architecture. (Version 7.13.0). We have a requirement, where we need to create multiple test classes with annotation @SpringBootTest, it executes first test class and fails on the second one throwing error for process engine exception. Can you please let me know what should be done for this ?
Can you be more specific.?
Show the code you’re running and the error you’re getting?
Also make sure to format the code and logs correctly by checking out the style guide
Hi,
Versions Used - 7.13.0
Sprint boot - 2.2.8
Annotations used for each test class:
@DirtiesContext
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = TestApplication.class, properties = { “camunda.bpm.job-execution.enabled=false”,
“camunda.bpm.auto-deployment-enabled=false” })
When I run, mvn clean install, it fails on the second test class and throws following exception
ERROR org.camunda.bpm.engine.context:160 - ENGINE-16004 Exception while closing command context: Cannot correlate message ‘updateServiceResponse’: No process definition or execution matches the parameters
org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message ‘updateServiceResponse’: No process definition or execution matches the parameters
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:88)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:42)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:46)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.execute(MessageCorrelationBuilderImpl.java:313)
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlateWithResult(MessageCorrelationBuilderImpl.java:224)
Please not that, when I execute test cases individually, one by one, they are working.
@jdhwani, refer this post.
Hi,
As I mentioned, the test classes run individually. This indicates that message co-relation code is already written. This is failing when two test classes are executed, It seems it is not able to initialise camunda spring boot engine properly with the second test class.