Camunda.bpm.enabled = false not working when running unit tests inside SpringBoot application

I am running non-Camunda unit tests for a SpringBoot application and get the following error:

***************************
APPLICATION FAILED TO START
***************************

Description:

Field camundaBpmProperties in org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication required a bean of type 'org.camunda.bpm.spring.boot.starter.property.CamundaBpmProperties' that could not be found.
2

Action:

Consider defining a bean of type 'org.camunda.bpm.spring.boot.starter.property.CamundaBpmProperties' in your configuration.

The application main class uses the @EnableProcessApplication annotation.

Having looked around at several posts on this, I have come to the conclusion that what I really want to do is disable the Camunda engine, therefore use the camunda.bpm.enabled property and set it to false. However in doing so, I still get the same error when running my tests.

My test application.yaml file looks like this:

camunda.bpm:
  enabled: false

The versions I am using are as follows:

Spring-Boot:  (v2.5.8)
Camunda Platform: (v7.16.0)
Camunda Platform Spring Boot Starter: (v7.16.0)

So is there something I am missing? Thanks in advance.

OK, so a solution one of my collegues suggested was creating a config class like this, and it worked:

@Configuration
@EnableProcessApplication("xxxx")
@ConditionalOnProperty(name = "camunda.bpm.enabled", havingValue = "true", matchIfMissing = true)
public class CamundaApplicationConfig {
}

Thanks. This worked for me. @EnableProcessApplication can be on either main class with @SprinbootApplication or on the config class.

Also make sure if you get any other exceptions :

  • make sure Java version is between 9 to15

  • update Spring boot versions to match older version (2.5.7 worked for me) and not Spring framework 6

  • made sure mvn clean and mvn install were run

  • update jaxb version and javax.servlet-api versions

1 Like