Hello Camunda Gurus,
I’m working to upgrade GitHub - berndruecker/customer-onboarding-camunda-8-springboot: A simple onboarding process example using BPMN, Camunda Cloud, Java, Spring Boot and REST to use latest Camunda 8.6.3. Tests fail with the following errors.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.berndruecker</groupId>
<artifactId>customer-onboarding-camunda-8-springboot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>Customer Onboarding Example Using Camunda 8 and Spring Boot</description>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<spring.boot.version>3.3.4</spring.boot.version>
<spring.zeebe.version>8.5.14</spring.zeebe.version>
<zeebe.version>8.6.3</zeebe.version>
<fatjar.mainClass>io.berndruecker.onboarding.customer.CustomerOnboardingSpringbootApplication</fatjar.mainClass>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-client-java</artifactId>
<version>${zeebe.version}</version>
</dependency>
<!--
<dependency>
<groupId>io.camunda</groupId>
<artifactId>spring-zeebe-starter</artifactId>
<version>${spring.zeebe.version}</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/io.camunda/spring-boot-starter-camunda-sdk -->
<dependency>
<groupId>io.camunda</groupId>
<artifactId>spring-boot-starter-camunda-sdk</artifactId>
<version>${zeebe.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda-test</artifactId>
<version>${spring.zeebe.version}</version>
<scope>test</scope>
</dependency>
<!-- for simple starter website -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<mainClass>io.berndruecker.onboarding.customer.CustomerOnboardingSpringbootApplication</mainClass>
</configuration>
</plugin>
<!-- Added this plugin to the configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<compilerArgs>
<arg>-verbose</arg>
<arg>-Xlint:all,-options,-path</arg>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- maven-assembly-plugin -->
<profile>
<id>assembly</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>${fatjar.mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- maven-shade-plugin -->
<profile>
<id>shade</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${fatjar.mainClass}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- onejar-maven-plugin -->
<profile>
<id>onejar</id>
<build>
<plugins>
<plugin>
<groupId>com.jolira</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>1.4.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>one-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>${fatjar.mainClass}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Console logs
INFO] [1m--- [0;32msurefire:3.5.1:test [m [1m(default-test) [m @ [36mcustomer-onboarding-camunda-8-springboot [0;1m --- [m
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.berndruecker.onboarding.customer. [1mTestCustomerOnboardingProcess [m
09:10:35.430 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [io.berndruecker.onboarding.customer.TestCustomerOnboardingProcess]: TestCustomerOnboardingProcess does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
[ERROR] [1;31mTests [0;1mrun: [0;1m1 [m, Failures: 0, [1;31mErrors: [0;1;31m1 [m, Skipped: 0, Time elapsed: 0.110 s [1;31m <<< FAILURE! [m -- in io.berndruecker.onboarding.customer. [1mTestCustomerOnboardingProcess [m
[ERROR] io.berndruecker.onboarding.customer.TestCustomerOnboardingProcess -- Time elapsed: 0.110 s <<< ERROR!
java.lang.IllegalStateException: Test classes cannot include @Bean methods
at org.springframework.util.Assert.state(Assert.java:76)
at org.springframework.boot.test.context.ImportsContextCustomizerFactory.assertHasNoBeanMethods(ImportsContextCustomizerFactory.java:63)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:366)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:342)
at org.springframework.boot.test.context.ImportsContextCustomizerFactory.assertHasNoBeanMethods(ImportsContextCustomizerFactory.java:59)
at org.springframework.boot.test.context.ImportsContextCustomizerFactory.createContextCustomizer(ImportsContextCustomizerFactory.java:52)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.getContextCustomizers(AbstractTestContextBootstrapper.java:360)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:332)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:267)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:215)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)
at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:111)
at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:142)
at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:126)
at org.springframework.test.context.junit.jupiter.SpringExtension.getTestContextManager(SpringExtension.java:366)
at org.springframework.test.context.junit.jupiter.SpringExtension.beforeAll(SpringExtension.java:131)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
[INFO]
[INFO] Results:
[INFO]
[ERROR] [1;31mErrors: [m
[ERROR] [1;31m TestCustomerOnboardingProcess » IllegalState Test classes cannot include @Bean methods [m
[INFO]
[ERROR] [1;31mTests run: 1, Failures: 0, Errors: 1, Skipped: 0 [m
[INFO]
[INFO] [1m------------------------------------------------------------------------ [m
[INFO] [1;31mBUILD FAILURE [m
[INFO] [1m------------------------------------------------------------------------ [m
[INFO] Total time: 2.185 s
[INFO] Finished at: 2024-10-22T09:10:35-05:00
[INFO] [1m------------------------------------------------------------------------ [m
[ERROR] Failed to execute goal [32morg.apache.maven.plugins:maven-surefire-plugin:3.5.1:test [m [1m(default-test) [m on project [36mcustomer-onboarding-camunda-8-springboot [m: [1;31m [m
[ERROR] [1;31m [m
[ERROR] [1;31mPlease refer to /Users/joe.doe/camunda8/customer-onboarding-camunda-8-springboot/target/surefire-reports for the individual test results. [m
[ERROR] [1;31mPlease refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [m
[ERROR] -> [1m[Help 1] [m
[ERROR]