This is an automated email from the ASF dual-hosted git repository. fmariani pushed a commit to branch spring-boot-4.0 in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
commit 74d28ca7dd81826540c5fdab38f013d512e57a04 Author: Croway <[email protected]> AuthorDate: Tue Nov 25 15:28:46 2025 +0100 Upgrade: Spring Boot 4.0 --- .../catalog/components/spring-rabbitmq.json | 4 +- components-starter/camel-activemq-starter/pom.xml | 8 + components-starter/camel-activemq6-starter/pom.xml | 8 + components-starter/camel-amqp-starter/pom.xml | 8 + .../aws2/s3/S3CreateDownloadLinkOperationTest.java | 8 +- .../camel-hashicorp-vault-starter/pom.xml | 8 + components-starter/camel-jms-starter/pom.xml | 8 + components-starter/camel-jpa-starter/pom.xml | 8 + .../camel-platform-http-starter/pom.xml | 29 +- .../SpringBootPlatformHttpAutoConfiguration.java | 2 +- .../SpringBootPlatformWebMvcConfiguration.java | 2 +- .../metrics/undertow/UndertowComponents.java | 25 -- .../actuate/metrics/undertow/UndertowMetrics.java | 338 --------------------- .../undertow/UndertowMetricsAutoConfiguration.java | 47 --- .../metrics/undertow/UndertowMetricsBinder.java | 86 ------ ...rk.boot.autoconfigure.AutoConfiguration.imports | 6 +- .../PlatformHttpAsyncRequestHandlingTest.java | 13 +- .../platform/http/springboot/PlatformHttpBase.java | 2 +- .../http/springboot/PlatformHttpStreamingTest.java | 4 +- .../SpringBootPlatformHttpBridgedEndpointTest.java | 4 +- ...pringBootPlatformHttpCamelIntegrationsTest.java | 6 +- ...ingBootPlatformHttpCamelVirtualThreadsTest.java | 4 +- .../SpringBootPlatformHttpCertificationTest.java | 4 +- .../SpringBootPlatformHttpCookiesTest.java | 6 +- .../SpringBootPlatformHttpCorsCredentialsTest.java | 4 +- .../springboot/SpringBootPlatformHttpCorsTest.java | 4 +- .../SpringBootPlatformHttpEngineTest.java | 6 +- ...SpringBootPlatformHttpHandleWriteErrorTest.java | 4 +- ...SpringBootPlatformHttpJacksonConverterTest.java | 6 +- ...pringBootPlatformHttpMultipleExecutorsTest.java | 4 +- ...ormHttpMultipleExecutorsVirtualThreadsTest.java | 4 +- .../SpringBootPlatformHttpOptionsTest.java | 7 +- .../SpringBootPlatformHttpProxyTest.java | 10 +- .../SpringBootPlatformHttpRequestTimeoutTest.java | 8 +- .../SpringBootPlatformHttpRestDSLTest.java | 6 +- .../SpringBootPlatformHttpSessionTest.java | 2 +- .../springboot/SpringBootPlatformHttpTest.java | 4 +- .../SpringBootPlatformHttpTypeConverterTest.java | 6 +- .../SpringBootPlatformHttpValidationTest.java | 6 +- ...ootPlatformHttpVirtualThreadsOptimizedTest.java | 4 +- .../SpringBootPlatformHttpVirtualThreadsTest.java | 4 +- components-starter/camel-pqc-starter/pom.xml | 8 + components-starter/camel-servlet-starter/pom.xml | 5 + .../ServletMappingAutoConfiguration.java | 2 +- .../camel-spring-batch-starter/pom.xml | 8 + .../camel-spring-cloud-config-starter/pom.xml | 4 + .../camel-spring-jdbc-starter/pom.xml | 8 + .../camel-spring-ldap-starter/pom.xml | 8 + .../camel-spring-rabbitmq-starter/pom.xml | 8 + .../src/main/docs/spring-rabbitmq.json | 4 +- .../SpringRabbitMQComponentConfiguration.java | 10 +- .../SpringRabbitMQComponentConverter.java | 4 +- .../camel-spring-redis-starter/pom.xml | 8 + components-starter/camel-spring-starter/pom.xml | 8 + components-starter/camel-spring-ws-starter/pom.xml | 8 + components-starter/camel-sql-starter/pom.xml | 8 + .../camel-undertow-spring-security-starter/pom.xml | 8 + core/camel-spring-boot/pom.xml | 6 + .../src/main/docs/spring-boot.json | 36 --- .../AsyncHealthIndicatorAutoConfiguration.java | 19 +- .../CamelAvailabilityCheckAutoConfiguration.java | 2 +- .../health/CamelHealthCheckAutoConfiguration.java | 2 +- .../actuate/health/CamelHealthCheckIndicator.java | 10 +- .../boot/actuate/health/CamelHealthHelper.java | 6 +- .../CamelLivenessStateHealthIndicator.java | 2 +- .../CamelReadinessStateHealthIndicator.java | 2 +- .../camel/spring/boot/aot/ReflectionHelper.java | 6 + .../boot/actuate/health/CamelHealthTest.java | 2 +- .../boot/actuate/health/CamelProbesTest.java | 11 +- 69 files changed, 298 insertions(+), 642 deletions(-) diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/spring-rabbitmq.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/spring-rabbitmq.json index 33fb9a052ee..67f0c58c79b 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/spring-rabbitmq.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/spring-rabbitmq.json @@ -43,7 +43,7 @@ "maxConcurrentConsumers": { "index": 16, "kind": "property", "displayName": "Max Concurrent Consumers", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "The maximum number of consumers (available only with SMLC)" }, "messageListenerContainerType": { "index": 17, "kind": "property", "displayName": "Message Listener Container Type", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "DMLC", "SMLC" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DMLC", "description": "The type of the MessageListenerContainer" }, "prefetchCount": { "index": 18, "kind": "property", "displayName": "Prefetch Count", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 250, "description": "Tell the broker how many messages to send to each consumer in a single request. Often this can be set quite high to improve throughput." }, - "retry": { "index": 19, "kind": "property", "displayName": "Retry", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.springframework.retry.interceptor.RetryOperationsInterceptor", "deprecated": false, "autowired": false, "secret": false, "description": "Custom retry configuration to use. If this is configured then the other settings such as maximumRetryAttempts for retry are not in use." }, + "retry": { "index": 19, "kind": "property", "displayName": "Retry", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor", "deprecated": false, "autowired": false, "secret": false, "description": "Custom retry configuration to use. If this is configured then the other settings such as maximumRetryAttempts for retry are not in use." }, "shutdownTimeout": { "index": 20, "kind": "property", "displayName": "Shutdown Timeout", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "5000", "description": "The time to wait for workers in milliseconds after the container is stopped. If any workers are active when the shutdown signal comes they will be allowed to finish processing as l [...] "allowNullBody": { "index": 21, "kind": "property", "displayName": "Allow Null Body", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow sending messages with no body. If this option is false and the message body is null, then an MessageConversionException is thrown." }, "autoDeclareProducer": { "index": 22, "kind": "property", "displayName": "Auto Declare Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Specifies whether the producer should auto declare binding between exchange, queue and routing key when starting. Enabling this can be good for development to make it easy to standup exchang [...] @@ -106,7 +106,7 @@ "maxConcurrentConsumers": { "index": 24, "kind": "parameter", "displayName": "Max Concurrent Consumers", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "The maximum number of consumers (available only with SMLC)" }, "messageListenerContainerType": { "index": 25, "kind": "parameter", "displayName": "Message Listener Container Type", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "DMLC", "SMLC" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DMLC", "description": "The type of the MessageListenerContainer" }, "prefetchCount": { "index": 26, "kind": "parameter", "displayName": "Prefetch Count", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Tell the broker how many messages to send in a single request. Often this can be set quite high to improve throughput." }, - "retry": { "index": 27, "kind": "parameter", "displayName": "Retry", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.springframework.retry.interceptor.RetryOperationsInterceptor", "deprecated": false, "autowired": false, "secret": false, "description": "Custom retry configuration to use. If this is configured then the other settings such as maximumRetryAttempts for retry are not in use." }, + "retry": { "index": 27, "kind": "parameter", "displayName": "Retry", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor", "deprecated": false, "autowired": false, "secret": false, "description": "Custom retry configuration to use. If this is configured then the other settings such as maximumRetryAttempts for retry are not in use." }, "allowNullBody": { "index": 28, "kind": "parameter", "displayName": "Allow Null Body", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow sending messages with no body. If this option is false and the message body is null, then an MessageConversionException is thrown." }, "autoDeclareProducer": { "index": 29, "kind": "parameter", "displayName": "Auto Declare Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Specifies whether the producer should auto declare binding between exchange, queue and routing key when starting." }, "confirm": { "index": 30, "kind": "parameter", "displayName": "Confirm", "group": "producer", "label": "producer", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "auto", "enabled", "disabled" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "auto", "description": "Controls whether to wait for confirms. The connection factory must be configured for publisher confirms and this method. auto = Camel detects if the connection facto [...] diff --git a/components-starter/camel-activemq-starter/pom.xml b/components-starter/camel-activemq-starter/pom.xml index 20efedf46bb..02aac6a8074 100644 --- a/components-starter/camel-activemq-starter/pom.xml +++ b/components-starter/camel-activemq-starter/pom.xml @@ -37,6 +37,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-activemq</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-activemq6-starter/pom.xml b/components-starter/camel-activemq6-starter/pom.xml index 4543c6a36c2..575dc67a9df 100644 --- a/components-starter/camel-activemq6-starter/pom.xml +++ b/components-starter/camel-activemq6-starter/pom.xml @@ -37,6 +37,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-activemq6</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-amqp-starter/pom.xml b/components-starter/camel-amqp-starter/pom.xml index 315695100e9..51f64212e94 100644 --- a/components-starter/camel-amqp-starter/pom.xml +++ b/components-starter/camel-amqp-starter/pom.xml @@ -38,6 +38,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-amqp</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-aws2-s3-starter/src/test/java/org/apache/camel/component/aws2/s3/S3CreateDownloadLinkOperationTest.java b/components-starter/camel-aws2-s3-starter/src/test/java/org/apache/camel/component/aws2/s3/S3CreateDownloadLinkOperationTest.java index 3838041911d..2d0d6990dcb 100644 --- a/components-starter/camel-aws2-s3-starter/src/test/java/org/apache/camel/component/aws2/s3/S3CreateDownloadLinkOperationTest.java +++ b/components-starter/camel-aws2-s3-starter/src/test/java/org/apache/camel/component/aws2/s3/S3CreateDownloadLinkOperationTest.java @@ -24,6 +24,7 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.springframework.boot.test.context.SpringBootTest; @@ -32,9 +33,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; import software.amazon.awssdk.services.s3.S3Client; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - //Based on S3CreateDownloadLinkOperationIT @DirtiesContext @CamelSpringBootTest @@ -75,8 +73,8 @@ public class S3CreateDownloadLinkOperationTest extends BaseS3 { } }); - assertNotNull(ex1.getMessage().getBody()); - assertNull(ex2.getMessage().getBody()); + Assertions.assertThat(ex1.getMessage().getBody()).isNotNull(); + Assertions.assertThat(ex2.getMessage().getBody()).isNull(); assertMockEndpointsSatisfied(); } diff --git a/components-starter/camel-hashicorp-vault-starter/pom.xml b/components-starter/camel-hashicorp-vault-starter/pom.xml index 0f1a069f376..74a05afda3a 100644 --- a/components-starter/camel-hashicorp-vault-starter/pom.xml +++ b/components-starter/camel-hashicorp-vault-starter/pom.xml @@ -37,6 +37,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-hashicorp-vault</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!-- for testing --> <dependency> diff --git a/components-starter/camel-jms-starter/pom.xml b/components-starter/camel-jms-starter/pom.xml index 9c3684b0012..03f37b01e97 100644 --- a/components-starter/camel-jms-starter/pom.xml +++ b/components-starter/camel-jms-starter/pom.xml @@ -37,6 +37,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-jms</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-jpa-starter/pom.xml b/components-starter/camel-jpa-starter/pom.xml index 60ad1378014..ccd00a91d1c 100644 --- a/components-starter/camel-jpa-starter/pom.xml +++ b/components-starter/camel-jpa-starter/pom.xml @@ -37,6 +37,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-jpa</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-platform-http-starter/pom.xml b/components-starter/camel-platform-http-starter/pom.xml index dfe61f3ebb3..38cabb97d6c 100644 --- a/components-starter/camel-platform-http-starter/pom.xml +++ b/components-starter/camel-platform-http-starter/pom.xml @@ -50,11 +50,20 @@ <version>${spring-boot-version}</version> </dependency> <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-security-oauth2-client</artifactId> + <version>${spring-boot-version}</version> + </dependency> + <!-- TODO reintroduce once spring-boot-starter-undertow will be available --> + <!-- AND CHERRY PICK --> + <!-- https://github.com/apache/camel-spring-boot/commit/1bb2b737a4cc1301945a1084e5a5cbb2e4744690 --> + <!-- https://github.com/apache/camel-spring-boot/commit/16e8983051d473638701edcbb8b333022ac2eb90 --> + <!--dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> <version>${spring-boot-version}</version> <optional>true</optional> - </dependency> + </dependency--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> @@ -85,6 +94,24 @@ <version>${spring-session-hazelcast-version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-restclient</artifactId> + <version>${spring-boot-version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-resttestclient</artifactId> + <version>${spring-boot-version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-webmvc-test</artifactId> + <version>${spring-boot-version}</version> + <scope>test</scope> + </dependency> <dependency> <groupId>com.hazelcast</groupId> <artifactId>hazelcast</artifactId> diff --git a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java index a9fdbc9d056..2f3ec376d40 100644 --- a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java +++ b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java @@ -24,8 +24,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; diff --git a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformWebMvcConfiguration.java b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformWebMvcConfiguration.java index d8b2d71e79d..b3c36c98f4d 100644 --- a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformWebMvcConfiguration.java +++ b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformWebMvcConfiguration.java @@ -17,8 +17,8 @@ package org.apache.camel.component.platform.http.springboot; import org.apache.camel.spring.boot.ComponentConfigurationProperties; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; diff --git a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowComponents.java b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowComponents.java deleted file mode 100644 index 0aab75a8846..00000000000 --- a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowComponents.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.platform.http.springboot.actuate.metrics.undertow; - -import io.undertow.Undertow; -import io.undertow.server.session.SessionManager; -import io.undertow.servlet.api.Deployment; -import org.xnio.XnioWorker; - -public record UndertowComponents(XnioWorker xnioWorker, SessionManager sessionManager, - Deployment deployment, Undertow undertow) { } diff --git a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetrics.java b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetrics.java deleted file mode 100644 index 1b64570dff6..00000000000 --- a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetrics.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.platform.http.springboot.actuate.metrics.undertow; - -import io.micrometer.core.instrument.FunctionCounter; -import io.micrometer.core.instrument.Gauge; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Tag; -import io.micrometer.core.instrument.Tags; -import io.micrometer.core.instrument.binder.BaseUnits; -import io.micrometer.core.instrument.binder.MeterBinder; -import io.undertow.server.session.SessionManager; -import io.undertow.servlet.api.Deployment; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xnio.XnioWorker; - -import javax.management.AttributeNotFoundException; -import javax.management.InstanceNotFoundException; -import javax.management.MBeanException; -import javax.management.MBeanServer; -import javax.management.ObjectName; -import javax.management.ReflectionException; -import java.lang.management.ManagementFactory; -import java.util.function.Supplier; - -/** - * {@link MeterBinder} for Undertow. - * <p> - * This binder provides metrics for XNIO worker threads and session management. - * - */ -public class UndertowMetrics implements MeterBinder, AutoCloseable { - private static final Logger LOG = LoggerFactory.getLogger(UndertowMetrics.class); - - private final XnioWorker xnioWorker; - private final SessionManager sessionManager; - private final Deployment deployment; - private final Iterable<Tag> tags; - private final MBeanServer mBeanServer; - - public UndertowMetrics(XnioWorker xnioWorker, - SessionManager sessionManager, - Iterable<Tag> tags) { - this(xnioWorker, sessionManager, null, tags, ManagementFactory.getPlatformMBeanServer()); - } - - public UndertowMetrics(XnioWorker xnioWorker, - SessionManager sessionManager, - Deployment deployment, - Iterable<Tag> tags) { - this(xnioWorker, sessionManager, deployment, tags, ManagementFactory.getPlatformMBeanServer()); - } - - public UndertowMetrics(XnioWorker xnioWorker, - SessionManager sessionManager, - Deployment deployment, - Iterable<Tag> tags, - MBeanServer mBeanServer) { - this.xnioWorker = xnioWorker; - this.sessionManager = sessionManager; - this.deployment = deployment; - this.tags = tags; - this.mBeanServer = mBeanServer; - } - - public static void monitor(MeterRegistry registry, - XnioWorker xnioWorker, - SessionManager sessionManager, - String... tags) { - monitor(registry, xnioWorker, sessionManager, Tags.of(tags)); - } - - public static void monitor(MeterRegistry registry, - XnioWorker xnioWorker, - SessionManager sessionManager, - Iterable<Tag> tags) { - new UndertowMetrics(xnioWorker, sessionManager, tags).bindTo(registry); - } - - public static void monitor(MeterRegistry registry, - XnioWorker xnioWorker, - SessionManager sessionManager, - Deployment deployment, - Iterable<Tag> tags) { - new UndertowMetrics(xnioWorker, sessionManager, deployment, tags).bindTo(registry); - } - - @Override - public void bindTo(MeterRegistry registry) { - registerWorkerThreadMetrics(registry); - registerSessionMetrics(registry); - registerJmxMetrics(registry); - } - - private void registerWorkerThreadMetrics(MeterRegistry registry) { - if (xnioWorker == null) { - return; - } - - // Core worker pool size - Gauge.builder("undertow.threads.worker.core", xnioWorker, this::getCoreWorkerPoolSize) - .tags(tags) - .baseUnit(BaseUnits.THREADS) - .description("Core worker thread pool size") - .register(registry); - - // Maximum worker pool size - Gauge.builder("undertow.threads.worker.max", xnioWorker, this::getMaxWorkerPoolSize) - .tags(tags) - .baseUnit(BaseUnits.THREADS) - .description("Maximum worker thread pool size") - .register(registry); - - // Current worker thread count - Gauge.builder("undertow.threads.worker.current", xnioWorker, this::getCurrentWorkerThreadCount) - .tags(tags) - .baseUnit(BaseUnits.THREADS) - .description("Current worker thread count") - .register(registry); - - // Busy worker thread count - Gauge.builder("undertow.threads.worker.busy", xnioWorker, this::getBusyWorkerThreadCount) - .tags(tags) - .baseUnit(BaseUnits.THREADS) - .description("Busy worker thread count") - .register(registry); - - // Worker thread utilization percentage - Gauge.builder("undertow.threads.worker.utilization", xnioWorker, this::getWorkerThreadUtilization) - .tags(tags) - .baseUnit(BaseUnits.PERCENT) - .description("Worker thread utilization percentage") - .register(registry); - - // Worker queue size - Gauge.builder("undertow.threads.worker.queue.size", xnioWorker, this::getWorkerQueueSize) - .tags(tags) - .description("Worker thread queue size") - .register(registry); - - // IO thread count - Gauge.builder("undertow.threads.io", xnioWorker, XnioWorker::getIoThreadCount) - .tags(tags) - .baseUnit(BaseUnits.THREADS) - .description("IO thread count") - .register(registry); - } - - private void registerSessionMetrics(MeterRegistry registry) { - if (sessionManager == null) { - return; - } - - // Active sessions - Gauge.builder("undertow.sessions.active.current", sessionManager, this::getActiveSessions) - .tags(tags) - .baseUnit(BaseUnits.SESSIONS) - .description("Current active sessions") - .register(registry); - - // Maximum sessions (if available) - Gauge.builder("undertow.sessions.active.max", sessionManager, this::getMaxSessions) - .tags(tags) - .baseUnit(BaseUnits.SESSIONS) - .description("Maximum sessions allowed") - .register(registry); - - // Session creation rate (if statistics are available) - FunctionCounter.builder("undertow.sessions.created", sessionManager, this::getCreatedSessions) - .tags(tags) - .baseUnit(BaseUnits.SESSIONS) - .description("Total sessions created") - .register(registry); - - // Expired sessions - FunctionCounter.builder("undertow.sessions.expired", sessionManager, this::getExpiredSessions) - .tags(tags) - .baseUnit(BaseUnits.SESSIONS) - .description("Total sessions expired") - .register(registry); - } - - private void registerJmxMetrics(MeterRegistry registry) { - // Register any available JMX-based metrics for Undertow - // This is a placeholder for when JMX beans are available - registerJmxMetricsIfAvailable(":type=thread-pool,name=*", registry); - } - - private void registerJmxMetricsIfAvailable(String objectNamePattern, MeterRegistry registry) { - try { - ObjectName pattern = new ObjectName("jboss.threads" + objectNamePattern); - var objectNames = mBeanServer.queryNames(pattern, null); - - for (ObjectName objectName : objectNames) { - // Register JMX-based thread pool metrics if available - registerJmxThreadPoolMetrics(objectName, registry); - } - } catch (Exception e) { - // JMX beans not available, skip - } - } - - private void registerJmxThreadPoolMetrics(ObjectName objectName, MeterRegistry registry) { - Iterable<Tag> allTags = Tags.concat(tags, Tags.of("name", getNameFromObjectName(objectName))); - - Gauge.builder("undertow.threads.jmx.active", mBeanServer, - s -> safeDouble(() -> { - try { - return s.getAttribute(objectName, "ActiveCount"); - } catch (Exception e) { - throw new RuntimeException(e); - } - })) - .tags(allTags) - .baseUnit(BaseUnits.THREADS) - .description("Active threads from JMX") - .register(registry); - - Gauge.builder("undertow.threads.jmx.pool.size", mBeanServer, - s -> safeDouble(() -> { - try { - return s.getAttribute(objectName, "PoolSize"); - } catch (Exception e) { - throw new RuntimeException(e); - } - })) - .tags(allTags) - .baseUnit(BaseUnits.THREADS) - .description("Thread pool size from JMX") - .register(registry); - } - - private double getCoreWorkerPoolSize(XnioWorker worker) { - return safeDouble(() -> this.xnioWorker.getMXBean().getCoreWorkerPoolSize()); - } - - private double getMaxWorkerPoolSize(XnioWorker worker) { - return safeDouble(() -> this.xnioWorker.getMXBean().getMaxWorkerPoolSize()); - } - - private double getCurrentWorkerThreadCount(XnioWorker worker) { - return safeDouble(() -> worker.getMXBean().getWorkerPoolSize()); - } - - private double getBusyWorkerThreadCount(XnioWorker worker) { - return safeDouble(() -> worker.getMXBean().getBusyWorkerThreadCount()); - } - - private double getWorkerThreadUtilization(XnioWorker worker) { - double current = getCurrentWorkerThreadCount(worker); - double total = getCoreWorkerPoolSize(worker); - if (total > 0 && !Double.isNaN(current) && !Double.isNaN(total)) { - return (current / total) * 100.0; - } - return Double.NaN; - } - - private double getWorkerQueueSize(XnioWorker worker) { - return safeDouble(() -> worker.getMXBean().getWorkerQueueSize()); - } - - // Session metrics - private double getActiveSessions(SessionManager manager) { - if (manager.getStatistics() != null) { - return safeDouble(() -> manager.getStatistics().getActiveSessionCount()); - } - if (deployment != null && deployment.getSessionManager() != null) { - return safeDouble(() -> deployment.getSessionManager().getActiveSessions().size()); - } - return Double.NaN; - } - - private double getMaxSessions(SessionManager manager) { - if (manager.getStatistics() != null) { - return safeDouble(() -> manager.getStatistics().getMaxActiveSessions()); - } - return Double.NaN; - } - - private double getCreatedSessions(SessionManager manager) { - if (manager.getStatistics() != null) { - return safeDouble(() -> manager.getStatistics().getCreatedSessionCount()); - } - return Double.NaN; - } - - private double getExpiredSessions(SessionManager manager) { - if (manager.getStatistics() != null) { - return safeDouble(() -> manager.getStatistics().getExpiredSessionCount()); - } - return Double.NaN; - } - - // Utility methods - private double safeDouble(Supplier<Object> supplier) { - try { - Object result = supplier.get(); - if (result == null) { - return Double.NaN; - } - if (result instanceof Number) { - return ((Number) result).doubleValue(); - } - return Double.parseDouble(result.toString()); - } catch (Exception e) { - LOG.trace(e.getMessage(), e); - return Double.NaN; - } - } - - private String getNameFromObjectName(ObjectName objectName) { - String name = objectName.getKeyProperty("name"); - return name != null ? name.replace("\"", "") : "unknown"; - } - - - @Override - public void close() { - // Cleanup any resources if needed - // Currently no resources to clean up, but this provides the interface - // for future enhancements - } -} diff --git a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetricsAutoConfiguration.java b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetricsAutoConfiguration.java deleted file mode 100644 index 9a52e0f55aa..00000000000 --- a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetricsAutoConfiguration.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.platform.http.springboot.actuate.metrics.undertow; - -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.binder.MeterBinder; -import io.undertow.Undertow; -import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration; -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Bean; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for {@link UndertowMetrics}. - * - */ -@AutoConfiguration(after = CompositeMeterRegistryAutoConfiguration.class) -@ConditionalOnWebApplication -@ConditionalOnClass({ Undertow.class, MeterBinder.class, CompositeMeterRegistryAutoConfiguration.class }) -public class UndertowMetricsAutoConfiguration { - - @Bean - @ConditionalOnBean(MeterRegistry.class) - @ConditionalOnMissingBean({ UndertowMetrics.class, UndertowMetricsBinder.class }) - public UndertowMetricsBinder undertowMetricsBinder(MeterRegistry meterRegistry) { - return new UndertowMetricsBinder(meterRegistry); - } - -} diff --git a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetricsBinder.java b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetricsBinder.java deleted file mode 100644 index fe1a23c1ecd..00000000000 --- a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/actuate/metrics/undertow/UndertowMetricsBinder.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.platform.http.springboot.actuate.metrics.undertow; - -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Tag; -import io.undertow.Undertow; -import io.undertow.servlet.api.DeploymentManager; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.boot.context.event.ApplicationStartedEvent; -import org.springframework.boot.web.context.WebServerApplicationContext; -import org.springframework.boot.web.embedded.undertow.UndertowServletWebServer; -import org.springframework.boot.web.server.WebServer; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationListener; -import org.xnio.XnioWorker; - -import java.util.Collections; - -public class UndertowMetricsBinder implements ApplicationListener<ApplicationStartedEvent>, DisposableBean { - - private final MeterRegistry meterRegistry; - private final Iterable<Tag> tags; - private volatile UndertowMetrics undertowMetrics; - - public UndertowMetricsBinder(MeterRegistry meterRegistry) { - this(meterRegistry, Collections.emptyList()); - } - - public UndertowMetricsBinder(MeterRegistry meterRegistry, Iterable<Tag> tags) { - this.meterRegistry = meterRegistry; - this.tags = tags; - } - - @Override - public void destroy() { - if (this.undertowMetrics != null) { - this.undertowMetrics.close(); - } - } - - @Override - public void onApplicationEvent(ApplicationStartedEvent event) { - ApplicationContext applicationContext = event.getApplicationContext(); - UndertowComponents undertowComponents = findUndertowComponents(applicationContext); - if (undertowComponents != null) { - this.undertowMetrics = new UndertowMetrics(undertowComponents.xnioWorker(), undertowComponents.sessionManager(), - undertowComponents.deployment(), tags); - this.undertowMetrics.bindTo(this.meterRegistry); - } - } - - private UndertowComponents findUndertowComponents(ApplicationContext applicationContext) { - if (applicationContext instanceof WebServerApplicationContext webServerApplicationContext) { - WebServer webServer = webServerApplicationContext.getWebServer(); - if (webServer instanceof UndertowServletWebServer undertowServletWebServer) { - Undertow undertow = undertowServletWebServer.getUndertow(); - XnioWorker xnioWorker = undertowServletWebServer.getUndertow().getWorker(); - DeploymentManager deploymentManager = undertowServletWebServer.getDeploymentManager(); - - return new UndertowComponents( - xnioWorker, - deploymentManager.getDeployment().getSessionManager(), - deploymentManager.getDeployment(), - undertow - ); - } - } - return null; - } - -} diff --git a/components-starter/camel-platform-http-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-platform-http-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 84a0a5df88d..0fff74df9c7 100644 --- a/components-starter/camel-platform-http-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/components-starter/camel-platform-http-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -19,4 +19,8 @@ org.apache.camel.component.platform.http.springboot.PlatformHttpComponentConvert org.apache.camel.component.platform.http.springboot.PlatformHttpComponentAutoConfiguration org.apache.camel.component.platform.http.springboot.SpringBootPlatformHttpAutoConfiguration org.apache.camel.component.platform.http.springboot.SpringBootPlatformWebMvcConfiguration -org.apache.camel.component.platform.http.springboot.actuate.metrics.undertow.UndertowMetricsAutoConfiguration \ No newline at end of file +## TODO reintroduce once spring-boot-starter-undertow will be available +## AND CHERRY PICK +## https://github.com/apache/camel-spring-boot/commit/1bb2b737a4cc1301945a1084e5a5cbb2e4744690 +## https://github.com/apache/camel-spring-boot/commit/16e8983051d473638701edcbb8b333022ac2eb90 +##org.apache.camel.component.platform.http.springboot.actuate.metrics.undertow.UndertowMetricsAutoConfiguration \ No newline at end of file diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpAsyncRequestHandlingTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpAsyncRequestHandlingTest.java index 4d265162fc9..75db7f055ef 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpAsyncRequestHandlingTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpAsyncRequestHandlingTest.java @@ -23,18 +23,21 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.asyncDispatch; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.request; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @EnableAutoConfiguration(exclude = {OAuth2ClientAutoConfiguration.class, SecurityAutoConfiguration.class}) @CamelSpringBootTest diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpBase.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpBase.java index 40b02e9f372..8deeee78eab 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpBase.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpBase.java @@ -22,7 +22,7 @@ import org.assertj.core.api.Assertions; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.resttestclient.TestRestTemplate; import org.springframework.http.HttpStatusCode; import java.util.concurrent.TimeUnit; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpStreamingTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpStreamingTest.java index b6766bad765..eac511a44fa 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpStreamingTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/PlatformHttpStreamingTest.java @@ -25,8 +25,8 @@ import org.apache.camel.util.IOHelper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBridgedEndpointTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBridgedEndpointTest.java index 003f44a548d..648c24e1e28 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBridgedEndpointTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBridgedEndpointTest.java @@ -26,8 +26,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelIntegrationsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelIntegrationsTest.java index 0cf28e0c0e6..813f0069403 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelIntegrationsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelIntegrationsTest.java @@ -26,10 +26,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java index 8ff89d556d2..b22e2323906 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java @@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.JRE; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCertificationTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCertificationTest.java index 28fa0bfa46e..33150ca724f 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCertificationTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCertificationTest.java @@ -51,8 +51,8 @@ import org.junit.jupiter.api.condition.DisabledIfSystemProperties; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCookiesTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCookiesTest.java index 0708967e6e7..cec45ae1375 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCookiesTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCookiesTest.java @@ -30,10 +30,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsCredentialsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsCredentialsTest.java index 7ec0a7383ac..348fda8a8eb 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsCredentialsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsCredentialsTest.java @@ -24,8 +24,8 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsTest.java index 8cc096efd5b..a8542633624 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCorsTest.java @@ -24,8 +24,8 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpEngineTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpEngineTest.java index c90ae75d25c..e47f0b74155 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpEngineTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpEngineTest.java @@ -30,10 +30,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpHandleWriteErrorTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpHandleWriteErrorTest.java index b318ea59347..0c35c40b2b9 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpHandleWriteErrorTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpHandleWriteErrorTest.java @@ -30,8 +30,8 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpJacksonConverterTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpJacksonConverterTest.java index bf369ad8f44..44285a91b64 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpJacksonConverterTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpJacksonConverterTest.java @@ -26,10 +26,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsTest.java index 3d4ce2f7ec1..8278a913b47 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsTest.java @@ -23,8 +23,8 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java index 9bcc715bfea..e7e24343223 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java @@ -23,8 +23,8 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.task.SimpleAsyncTaskExecutorBuilder; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpOptionsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpOptionsTest.java index 086b158a904..2bdcc56992c 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpOptionsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpOptionsTest.java @@ -23,15 +23,16 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import static io.restassured.RestAssured.given; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; @EnableAutoConfiguration(exclude = {OAuth2ClientAutoConfiguration.class, SecurityAutoConfiguration.class}) @CamelSpringBootTest diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpProxyTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpProxyTest.java index 056c3fe37f2..e659f0f74c5 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpProxyTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpProxyTest.java @@ -29,17 +29,19 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.wiremock.spring.ConfigureWireMock; import org.wiremock.spring.EnableWireMock; -import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.containsString; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRequestTimeoutTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRequestTimeoutTest.java index 195144a4c20..6ff94a153db 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRequestTimeoutTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRequestTimeoutTest.java @@ -23,11 +23,11 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatusCode; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRestDSLTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRestDSLTest.java index 97dc2e88e02..3663a578f41 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRestDSLTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpRestDSLTest.java @@ -20,8 +20,10 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpSessionTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpSessionTest.java index b52e764dcb4..54dee2e9484 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpSessionTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpSessionTest.java @@ -29,8 +29,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTest.java index b69cf6ddf0e..a3418133c26 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTest.java @@ -20,8 +20,8 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTypeConverterTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTypeConverterTest.java index 66cf1def32a..63c384e75f6 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTypeConverterTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpTypeConverterTest.java @@ -25,10 +25,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpValidationTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpValidationTest.java index 9418e9a376b..c90a390301b 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpValidationTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpValidationTest.java @@ -31,10 +31,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.resttestclient.TestRestTemplate; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; 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 dcd9b48d515..4eba934a178 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 @@ -24,8 +24,8 @@ import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.JRE; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java index 7cd0912e53e..4eab98a11b6 100644 --- a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java @@ -22,8 +22,8 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.JRE; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-pqc-starter/pom.xml b/components-starter/camel-pqc-starter/pom.xml index 271766ae473..cc1d4f0a5f2 100644 --- a/components-starter/camel-pqc-starter/pom.xml +++ b/components-starter/camel-pqc-starter/pom.xml @@ -37,6 +37,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-pqc</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-servlet-starter/pom.xml b/components-starter/camel-servlet-starter/pom.xml index 134e6e89041..095d0469bb9 100644 --- a/components-starter/camel-servlet-starter/pom.xml +++ b/components-starter/camel-servlet-starter/pom.xml @@ -50,6 +50,11 @@ <version>${jakarta-servlet-api-version}</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-servlet</artifactId> + <version>${spring-boot-version}</version> + </dependency> <!-- Test dependencies --> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletMappingAutoConfiguration.java b/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletMappingAutoConfiguration.java index 61d3c465748..b386aaba538 100644 --- a/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletMappingAutoConfiguration.java +++ b/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletMappingAutoConfiguration.java @@ -24,8 +24,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.web.servlet.MultipartProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.servlet.autoconfigure.MultipartProperties; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/components-starter/camel-spring-batch-starter/pom.xml b/components-starter/camel-spring-batch-starter/pom.xml index b619de66bef..052793bf5c7 100644 --- a/components-starter/camel-spring-batch-starter/pom.xml +++ b/components-starter/camel-spring-batch-starter/pom.xml @@ -38,6 +38,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-batch</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-spring-cloud-config-starter/pom.xml b/components-starter/camel-spring-cloud-config-starter/pom.xml index 644581f7f27..3a9f78737a5 100644 --- a/components-starter/camel-spring-cloud-config-starter/pom.xml +++ b/components-starter/camel-spring-cloud-config-starter/pom.xml @@ -47,6 +47,10 @@ <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> </exclusions> <!--END OF GENERATED CODE--> </dependency> diff --git a/components-starter/camel-spring-jdbc-starter/pom.xml b/components-starter/camel-spring-jdbc-starter/pom.xml index c73f179fa67..028b0ad7932 100644 --- a/components-starter/camel-spring-jdbc-starter/pom.xml +++ b/components-starter/camel-spring-jdbc-starter/pom.xml @@ -42,6 +42,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-jdbc</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-spring-ldap-starter/pom.xml b/components-starter/camel-spring-ldap-starter/pom.xml index 1543d009c45..d2687df4317 100644 --- a/components-starter/camel-spring-ldap-starter/pom.xml +++ b/components-starter/camel-spring-ldap-starter/pom.xml @@ -38,6 +38,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-ldap</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-spring-rabbitmq-starter/pom.xml b/components-starter/camel-spring-rabbitmq-starter/pom.xml index fa582962237..b3faeea4a89 100644 --- a/components-starter/camel-spring-rabbitmq-starter/pom.xml +++ b/components-starter/camel-spring-rabbitmq-starter/pom.xml @@ -37,6 +37,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-rabbitmq</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-spring-rabbitmq-starter/src/main/docs/spring-rabbitmq.json b/components-starter/camel-spring-rabbitmq-starter/src/main/docs/spring-rabbitmq.json index 19ce46c5f3a..6b6d5e7be5f 100644 --- a/components-starter/camel-spring-rabbitmq-starter/src/main/docs/spring-rabbitmq.json +++ b/components-starter/camel-spring-rabbitmq-starter/src/main/docs/spring-rabbitmq.json @@ -203,8 +203,8 @@ }, { "name": "camel.component.spring-rabbitmq.retry", - "type": "org.springframework.retry.interceptor.RetryOperationsInterceptor", - "description": "Custom retry configuration to use. If this is configured then the other settings such as maximumRetryAttempts for retry are not in use. The option is a org.springframework.retry.interceptor.RetryOperationsInterceptor type.", + "type": "org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor", + "description": "Custom retry configuration to use. If this is configured then the other settings such as maximumRetryAttempts for retry are not in use. The option is a org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor type.", "sourceType": "org.apache.camel.component.springrabbit.springboot.SpringRabbitMQComponentConfiguration" }, { diff --git a/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConfiguration.java b/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConfiguration.java index e0ca855a356..d9e5fd6262e 100644 --- a/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConfiguration.java +++ b/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConfiguration.java @@ -22,10 +22,10 @@ import org.apache.camel.component.springrabbit.MessagePropertiesConverter; import org.apache.camel.spi.HeaderFilterStrategy; import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; import org.springframework.amqp.core.AmqpAdmin; +import org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.support.converter.MessageConverter; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.retry.interceptor.RetryOperationsInterceptor; import org.springframework.util.ErrorHandler; /** @@ -153,9 +153,9 @@ public class SpringRabbitMQComponentConfiguration * Custom retry configuration to use. If this is configured then the other * settings such as maximumRetryAttempts for retry are not in use. The * option is a - * org.springframework.retry.interceptor.RetryOperationsInterceptor type. + * org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor type. */ - private RetryOperationsInterceptor retry; + private StatelessRetryOperationsInterceptor retry; /** * The time to wait for workers in milliseconds after the container is * stopped. If any workers are active when the shutdown signal comes they @@ -388,11 +388,11 @@ public class SpringRabbitMQComponentConfiguration this.prefetchCount = prefetchCount; } - public RetryOperationsInterceptor getRetry() { + public StatelessRetryOperationsInterceptor getRetry() { return retry; } - public void setRetry(RetryOperationsInterceptor retry) { + public void setRetry(StatelessRetryOperationsInterceptor retry) { this.retry = retry; } diff --git a/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConverter.java b/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConverter.java index 29cbc848399..e662f6265a0 100644 --- a/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConverter.java +++ b/components-starter/camel-spring-rabbitmq-starter/src/main/java/org/apache/camel/component/springrabbit/springboot/SpringRabbitMQComponentConverter.java @@ -43,7 +43,7 @@ public class SpringRabbitMQComponentConverter implements GenericConverter { answer.add(new ConvertiblePair(String.class, org.springframework.amqp.rabbit.connection.ConnectionFactory.class)); answer.add(new ConvertiblePair(String.class, org.springframework.util.ErrorHandler.class)); answer.add(new ConvertiblePair(String.class, org.apache.camel.component.springrabbit.ListenerContainerFactory.class)); - answer.add(new ConvertiblePair(String.class, org.springframework.retry.interceptor.RetryOperationsInterceptor.class)); + answer.add(new ConvertiblePair(String.class, org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor.class)); answer.add(new ConvertiblePair(String.class, org.springframework.amqp.support.converter.MessageConverter.class)); answer.add(new ConvertiblePair(String.class, org.apache.camel.component.springrabbit.MessagePropertiesConverter.class)); answer.add(new ConvertiblePair(String.class, org.apache.camel.spi.HeaderFilterStrategy.class)); @@ -67,7 +67,7 @@ public class SpringRabbitMQComponentConverter implements GenericConverter { case "org.springframework.amqp.rabbit.connection.ConnectionFactory": return applicationContext.getBean(ref, org.springframework.amqp.rabbit.connection.ConnectionFactory.class); case "org.springframework.util.ErrorHandler": return applicationContext.getBean(ref, org.springframework.util.ErrorHandler.class); case "org.apache.camel.component.springrabbit.ListenerContainerFactory": return applicationContext.getBean(ref, org.apache.camel.component.springrabbit.ListenerContainerFactory.class); - case "org.springframework.retry.interceptor.RetryOperationsInterceptor": return applicationContext.getBean(ref, org.springframework.retry.interceptor.RetryOperationsInterceptor.class); + case "org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor": return applicationContext.getBean(ref, org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptor.class); case "org.springframework.amqp.support.converter.MessageConverter": return applicationContext.getBean(ref, org.springframework.amqp.support.converter.MessageConverter.class); case "org.apache.camel.component.springrabbit.MessagePropertiesConverter": return applicationContext.getBean(ref, org.apache.camel.component.springrabbit.MessagePropertiesConverter.class); case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class); diff --git a/components-starter/camel-spring-redis-starter/pom.xml b/components-starter/camel-spring-redis-starter/pom.xml index 3c5272c1a54..97d0f4ef702 100644 --- a/components-starter/camel-spring-redis-starter/pom.xml +++ b/components-starter/camel-spring-redis-starter/pom.xml @@ -38,6 +38,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-redis</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-spring-starter/pom.xml b/components-starter/camel-spring-starter/pom.xml index dc6cb0acbc3..5c82b67a779 100644 --- a/components-starter/camel-spring-starter/pom.xml +++ b/components-starter/camel-spring-starter/pom.xml @@ -38,6 +38,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-spring-ws-starter/pom.xml b/components-starter/camel-spring-ws-starter/pom.xml index 5fa2184649c..88f1bcd7c6d 100644 --- a/components-starter/camel-spring-ws-starter/pom.xml +++ b/components-starter/camel-spring-ws-starter/pom.xml @@ -43,6 +43,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-ws</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <!--START OF GENERATED CODE--> <dependency> diff --git a/components-starter/camel-sql-starter/pom.xml b/components-starter/camel-sql-starter/pom.xml index e0f32ecb7a1..257ed49c15d 100644 --- a/components-starter/camel-sql-starter/pom.xml +++ b/components-starter/camel-sql-starter/pom.xml @@ -38,6 +38,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-sql</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/components-starter/camel-undertow-spring-security-starter/pom.xml b/components-starter/camel-undertow-spring-security-starter/pom.xml index 4bd7be246ec..32c52a31aa7 100644 --- a/components-starter/camel-undertow-spring-security-starter/pom.xml +++ b/components-starter/camel-undertow-spring-security-starter/pom.xml @@ -38,6 +38,14 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-undertow-spring-security</artifactId> <version>${camel-version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> </dependency> <dependency> <groupId>org.apache.camel.springboot</groupId> diff --git a/core/camel-spring-boot/pom.xml b/core/camel-spring-boot/pom.xml index dcbdbd07e04..18f258316bd 100644 --- a/core/camel-spring-boot/pom.xml +++ b/core/camel-spring-boot/pom.xml @@ -95,6 +95,12 @@ </dependency> <!-- Testing dependencies --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-restclient</artifactId> + <version>${spring-boot-version}</version> + <scope>test</scope> + </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-xml</artifactId> diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json b/core/camel-spring-boot/src/main/docs/spring-boot.json index ae91b559094..2705f05a5ee 100644 --- a/core/camel-spring-boot/src/main/docs/spring-boot.json +++ b/core/camel-spring-boot/src/main/docs/spring-boot.json @@ -2164,42 +2164,6 @@ "replacement": "camel.main.run-controller", "since": "4.14.0" } - }, - { - "name": "management.endpoint.camel.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable the camel endpoint.", - "sourceType": "org.apache.camel.spring.boot.actuate.console.CamelDevConsoleEndpoint", - "defaultValue": true, - "deprecated": true, - "deprecation": { - "replacement": "management.endpoint.camel.access", - "since": "3.4.0" - } - }, - { - "name": "management.endpoint.camelroutecontroller.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable the camelroutecontroller endpoint.", - "sourceType": "org.apache.camel.spring.boot.actuate.endpoint.CamelRouteControllerEndpoint", - "defaultValue": true, - "deprecated": true, - "deprecation": { - "replacement": "management.endpoint.camelroutecontroller.access", - "since": "3.4.0" - } - }, - { - "name": "management.endpoint.camelroutes.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable the camelroutes endpoint.", - "sourceType": "org.apache.camel.spring.boot.actuate.endpoint.CamelRoutesEndpoint", - "defaultValue": true, - "deprecated": true, - "deprecation": { - "replacement": "management.endpoint.camelroutes.access", - "since": "3.4.0" - } } ], "hints": [], diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/AsyncHealthIndicatorAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/AsyncHealthIndicatorAutoConfiguration.java index 44d42afe377..0b776ef4c15 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/AsyncHealthIndicatorAutoConfiguration.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/AsyncHealthIndicatorAutoConfiguration.java @@ -16,22 +16,23 @@ */ package org.apache.camel.spring.boot.actuate.health; -import java.time.Duration; -import java.time.ZonedDateTime; import org.apache.camel.spring.boot.actuate.health.liveness.CamelLivenessStateHealthIndicator; import org.apache.camel.spring.boot.actuate.health.readiness.CamelReadinessStateHealthIndicator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.boot.actuate.health.Health; -import org.springframework.boot.actuate.health.HealthContributorRegistry; -import org.springframework.boot.actuate.health.HealthIndicator; -import org.springframework.boot.actuate.health.NamedContributor; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.health.contributor.Health; +import org.springframework.boot.health.contributor.HealthContributors; +import org.springframework.boot.health.contributor.HealthIndicator; +import org.springframework.boot.health.registry.HealthContributorRegistry; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; +import java.time.Duration; +import java.time.ZonedDateTime; + /** * Configuration class that replace synchronous Camel Health Checks with asynchronous ones. * @@ -63,9 +64,9 @@ public class AsyncHealthIndicatorAutoConfiguration implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { - for (NamedContributor<?> namedContributor : healthContributorRegistry) { - final String name = namedContributor.getName(); - final Object contributor = namedContributor.getContributor(); + for (HealthContributors.Entry entryContributor : healthContributorRegistry) { + final String name = entryContributor.name(); + final Object contributor = entryContributor.contributor(); if (contributor instanceof CamelHealthCheckIndicator || contributor instanceof CamelLivenessStateHealthIndicator || contributor instanceof CamelReadinessStateHealthIndicator) { diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelAvailabilityCheckAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelAvailabilityCheckAutoConfiguration.java index fe7d2bb6c1f..acdc5a980e1 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelAvailabilityCheckAutoConfiguration.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelAvailabilityCheckAutoConfiguration.java @@ -21,12 +21,12 @@ import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.actuate.health.liveness.CamelLivenessStateHealthIndicator; import org.apache.camel.spring.boot.actuate.health.readiness.CamelReadinessStateHealthIndicator; -import org.springframework.boot.actuate.availability.LivenessStateHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.availability.ApplicationAvailability; +import org.springframework.boot.health.application.LivenessStateHealthIndicator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java index 3df41a361d7..df64e3bab67 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java @@ -24,12 +24,12 @@ import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory; -import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.health.contributor.HealthIndicator; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckIndicator.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckIndicator.java index 4d4ca4c7dfe..cc481dacb71 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckIndicator.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckIndicator.java @@ -16,17 +16,17 @@ */ package org.apache.camel.spring.boot.actuate.health; -import java.util.Collection; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.health.HealthCheck; import org.apache.camel.health.HealthCheckHelper; import org.apache.camel.impl.health.AbstractHealthCheck; -import org.springframework.boot.actuate.health.AbstractHealthIndicator; -import org.springframework.boot.actuate.health.Health; -import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.boot.health.contributor.AbstractHealthIndicator; +import org.springframework.boot.health.contributor.Health; import org.springframework.context.ApplicationContext; +import java.util.Collection; +import java.util.Map; + /** * Camel {@link HealthIndicator}. */ diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java index ac64499765c..0f761f85c53 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java @@ -16,14 +16,14 @@ */ package org.apache.camel.spring.boot.actuate.health; +import org.apache.camel.health.HealthCheck; +import org.springframework.boot.health.contributor.Health; + import java.io.PrintWriter; import java.io.StringWriter; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; -import java.util.TreeMap; -import org.apache.camel.health.HealthCheck; -import org.springframework.boot.actuate.health.Health; final class CamelHealthHelper { diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/liveness/CamelLivenessStateHealthIndicator.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/liveness/CamelLivenessStateHealthIndicator.java index a9771efce91..9f9ad805077 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/liveness/CamelLivenessStateHealthIndicator.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/liveness/CamelLivenessStateHealthIndicator.java @@ -23,10 +23,10 @@ import org.apache.camel.health.HealthCheckHelper; import org.apache.camel.spring.boot.actuate.health.CamelProbesHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.boot.actuate.availability.LivenessStateHealthIndicator; import org.springframework.boot.availability.ApplicationAvailability; import org.springframework.boot.availability.AvailabilityState; import org.springframework.boot.availability.LivenessState; +import org.springframework.boot.health.application.LivenessStateHealthIndicator; public class CamelLivenessStateHealthIndicator extends LivenessStateHealthIndicator { diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/readiness/CamelReadinessStateHealthIndicator.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/readiness/CamelReadinessStateHealthIndicator.java index b4a034a8939..cce7f3f36f6 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/readiness/CamelReadinessStateHealthIndicator.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/readiness/CamelReadinessStateHealthIndicator.java @@ -23,10 +23,10 @@ import org.apache.camel.health.HealthCheckHelper; import org.apache.camel.spring.boot.actuate.health.CamelProbesHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator; import org.springframework.boot.availability.ApplicationAvailability; import org.springframework.boot.availability.AvailabilityState; import org.springframework.boot.availability.ReadinessState; +import org.springframework.boot.health.application.ReadinessStateHealthIndicator; public class CamelReadinessStateHealthIndicator extends ReadinessStateHealthIndicator { diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/aot/ReflectionHelper.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/aot/ReflectionHelper.java index 637e29fb3f7..bd673b75683 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/aot/ReflectionHelper.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/aot/ReflectionHelper.java @@ -36,6 +36,7 @@ import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.type.AnnotationMetadata; import org.springframework.core.type.ClassMetadata; @@ -247,5 +248,10 @@ public final class ReflectionHelper { } return DEFAULT; } + + @Override + public ResourceLoader getResourceLoader() { + return delegate.getResourceLoader(); + } } } diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelHealthTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelHealthTest.java index 37f73010514..5b30e2fcd79 100644 --- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelHealthTest.java +++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelHealthTest.java @@ -22,9 +22,9 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.actuate.health.Health; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.health.contributor.Health; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.DirtiesContext; diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelProbesTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelProbesTest.java index 84f596ad676..5189d301c05 100644 --- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelProbesTest.java +++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/health/CamelProbesTest.java @@ -16,7 +16,6 @@ */ package org.apache.camel.spring.boot.actuate.health; -import java.io.IOException; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.assertj.core.api.Assertions; @@ -24,9 +23,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.restclient.RestTemplateBuilder; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalManagementPort; -import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatusCode; @@ -34,6 +33,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.http.client.ClientHttpResponse; import org.springframework.web.client.ResponseErrorHandler; +import java.io.IOException; + @CamelSpringBootTest @EnableAutoConfiguration @SpringBootApplication @@ -55,15 +56,15 @@ public class CamelProbesTest { public void testMetrics() { ResponseEntity<String> livenessResponse = restTemplateBuilder .rootUri("http://localhost:" + managementPort + "/actuator").build() - .exchange("/health/liveness", HttpMethod.GET, new HttpEntity<>(null), String.class); + .exchange("/health/liveness", HttpMethod.GET, HttpEntity.EMPTY, String.class); ResponseEntity<String> readinessResponse = restTemplateBuilder.errorHandler(new NoOpErrorHandler()) .rootUri("http://localhost:" + managementPort + "/actuator").build() - .exchange("/health/readiness", HttpMethod.GET, new HttpEntity<>(null), String.class); + .exchange("/health/readiness", HttpMethod.GET, HttpEntity.EMPTY, String.class); ResponseEntity<String> healthResponse = restTemplateBuilder.errorHandler(new NoOpErrorHandler()) .rootUri("http://localhost:" + managementPort + "/actuator").build() - .exchange("/health", HttpMethod.GET, new HttpEntity<>(null), String.class); + .exchange("/health", HttpMethod.GET, HttpEntity.EMPTY, String.class); Assertions.assertThat(livenessResponse.getStatusCode()).isEqualTo(HttpStatusCode.valueOf(200)); Assertions.assertThat(livenessResponse.getBody()).isEqualTo("{\"status\":\"UP\"}");
