This is an automated email from the ASF dual-hosted git repository.

fmariani pushed a commit to branch fix-virtual-threads-optimized-test
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit 66dc4011b21d329967777f70b09e2c91f5f86f8a
Author: Croway <[email protected]>
AuthorDate: Fri Mar 27 18:38:08 2026 +0100

    Fix SpringBootPlatformHttpVirtualThreadsOptimizedTest for Spring Boot 4.0.4
    
    Spring Boot 4.0.4's TaskExecutionAutoConfiguration uses
    @ConditionalOnMissingBean(Executor.class) when auto-configuring the
    SimpleAsyncTaskExecutor for virtual threads. When another Executor bean
    is registered first (e.g. by Spring Security auto-configuration), the
    auto-config backs off and no SimpleAsyncTaskExecutor is created, causing
    the test assertion to fail.
    
    Explicitly define a SimpleAsyncTaskExecutor bean in the test's
    TestConfiguration using SimpleAsyncTaskExecutorBuilder, matching the
    approach used by the passing
    SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---
 .../SpringBootPlatformHttpVirtualThreadsOptimizedTest.java          | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
 
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
index ce3f3f09399..9062616088c 100644
--- 
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
+++ 
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
@@ -25,6 +25,7 @@ import 
org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.boot.task.SimpleAsyncTaskExecutorBuilder;
 import org.springframework.core.task.SimpleAsyncTaskExecutor;
 import 
org.springframework.security.config.annotation.web.builders.HttpSecurity;
 import org.springframework.security.web.SecurityFilterChain;
@@ -61,6 +62,11 @@ public class 
SpringBootPlatformHttpVirtualThreadsOptimizedTest extends PlatformH
             return http.build();
         }
 
+        @Bean
+        public SimpleAsyncTaskExecutor 
simpleAsyncTaskExecutor(SimpleAsyncTaskExecutorBuilder 
simpleAsyncTaskExecutorBuilder) {
+            return simpleAsyncTaskExecutorBuilder.build();
+        }
+
         @Bean
         public RouteBuilder servletPlatformHttpRouteBuilder() {
             return new RouteBuilder() {

Reply via email to