Camunda coverage Spring Boot 3 junit 5

Hi,

We are using in our application the following versions with maven:

<dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>7.18.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
<dependency>
            <groupId>org.camunda.bpm.extension</groupId>
            <artifactId>camunda-bpm-process-test-coverage-spring-test</artifactId>
            <version>1.0.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.camunda.bpm.extension</groupId>
            <artifactId>camunda-bpm-process-test-coverage-junit5</artifactId>
            <version>1.0.3</version>
            <scope>test</scope>
        </dependency>


  <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>3.2.0</version>
    </parent>

We try to initialize the camunda process engine with junit 5 like this:

@RegisterExtension
    ProcessEngineExtension extension = ProcessEngineCoverageExtension
            .builder("camunda-unit-test.cfg.xml").build();

With Spring Boot 2 we have no issues.
But with Spring Boot 3 we are getting the exception:

Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'jdbcUrl' of bean class [org.camunda.bpm.extension.process_test_coverage.engine.ProcessCoverageInMemProcessEngineConfiguration]: Bean property 'jdbcUrl' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
	at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:206)
	at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:430)
	at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278)
	at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266)
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104)
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:79)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1719)
	... 22 more

Is there are workaround for this issue? Or does anybody know a solution for this?

best regards

Hi @jschuh
Not sure if you noticed, but just for your information, I do not see Spring Boot 3.x listed among the supported versions for Camunda 7.18 or even 7.19. The closest supported version is 7.20.x, so a possible workaround is to upgrade Camunda to 7.20 if you need to stick with Spring Boot 3.x for some reason.

Regards,
Alex

Hi,

Thanks for the information. I updated our camunda-bom to 7.21.0.

But unfortunately the error from the first post still appears.

best regards

Could you share what your database connection configuration looks like?

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="processEngineConfiguration" class="org.camunda.bpm.extension.process_test_coverage.engine.ProcessCoverageInMemProcessEngineConfiguration">

    <property name="jdbcUrl" value="jdbc:h2:mem:camunda;DB_CLOSE_DELAY=1000" />
    <property name="jdbcDriver" value="org.h2.Driver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />
    <property name="databaseSchemaUpdate" value="true" />
	<property name="jobExecutorActivate" value="false" />

	<property name="expressionManager">
		<bean class="org.camunda.bpm.engine.test.mock.MockExpressionManager" />
	</property>
	<property name="processEnginePlugins">
		<list>
			<bean class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
		</list>
	</property>
    
  </bean>

</beans>

This is our config file

I found the solution.

i changed the class from this

org.camunda.bpm.extension.process_test_coverage.engine.ProcessCoverageInMemProcessEngineConfiguration

to this

org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration

and now its working