Unable to get tests to run after updating Camunda version to 8.6.3

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] 

I resolved the “test” issue. I was using 3.3.x spring.boot instead of 3.2.x. I also got the SpringBootApp to run within Eclipse.

However, when I build a fatJar from the SpringBoot app, try to run with standalone “java -jar” I get the error shown below. Any thoughts why that may be?


13:58:01.157 [main] INFO io.berndruecker.onboarding.customer.CustomerOnboardingSpringbootApplication -- Starting CustomerOnboardingSpringbootApplication using Java 23.0.1 with PID 83455 (/Users/atul.tewari/camunda8/customer-onboarding-camunda-8-springboot/target/customer-onboarding-camunda-8-springboot-0.0.1-SNAPSHOT-jar-with-dependencies.jar started by atul.tewari in /Users/atul.tewari/camunda8/customer-onboarding-camunda-8-springboot/target)
13:58:01.159 [main] INFO io.berndruecker.onboarding.customer.CustomerOnboardingSpringbootApplication -- No active profile set, falling back to 1 default profile: "default"
13:58:01.511 [main] WARN org.springframework.context.annotation.AnnotationConfigApplicationContext -- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerOnboardingRestController': Unsatisfied dependency expressed through field 'client': No qualifying bean of type 'io.camunda.zeebe.client.ZeebeClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
13:58:01.513 [main] ERROR org.springframework.boot.SpringApplication -- Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerOnboardingRestController': Unsatisfied dependency expressed through field 'client': No qualifying bean of type 'io.camunda.zeebe.client.ZeebeClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:788)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:768)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:509)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1439)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
	at io.berndruecker.onboarding.customer.CustomerOnboardingSpringbootApplication.main(CustomerOnboardingSpringbootApplication.java:14)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'io.camunda.zeebe.client.ZeebeClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1880)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1406)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:785)
	... 19 common frames omitted

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.