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 33fb9a052ee7..67f0c58c79b7 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 long as they can finish within this timeout." }, "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 exchanges, queues and bindings on the broker." }, @@ -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 factory uses confirms or not. disabled = Confirms is disabled. enabled = Confirms is enabled." }, diff --git a/components-starter/camel-activemq-starter/pom.xml b/components-starter/camel-activemq-starter/pom.xml index 20efedf46bbe..02aac6a8074c 100644 --- a/components-starter/camel-activemq-starter/pom.xml +++ b/components-starter/camel-activemq-starter/pom.xml @@ -37,6 +37,14 @@ org.apache.camel camel-activemq ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-activemq6-starter/pom.xml b/components-starter/camel-activemq6-starter/pom.xml index 4543c6a36c21..575dc67a9df9 100644 --- a/components-starter/camel-activemq6-starter/pom.xml +++ b/components-starter/camel-activemq6-starter/pom.xml @@ -37,6 +37,14 @@ org.apache.camel camel-activemq6 ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-amqp-starter/pom.xml b/components-starter/camel-amqp-starter/pom.xml index 315695100e90..51f64212e94f 100644 --- a/components-starter/camel-amqp-starter/pom.xml +++ b/components-starter/camel-amqp-starter/pom.xml @@ -38,6 +38,14 @@ org.apache.camel camel-amqp ${camel-version} + + + + commons-logging + commons-logging + + + 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 3838041911d7..2d0d6990dcbf 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.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.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 void process(Exchange exchange) { } }); - 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 0f1a069f376c..74a05afda3a4 100644 --- a/components-starter/camel-hashicorp-vault-starter/pom.xml +++ b/components-starter/camel-hashicorp-vault-starter/pom.xml @@ -37,6 +37,14 @@ org.apache.camel camel-hashicorp-vault ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-jms-starter/pom.xml b/components-starter/camel-jms-starter/pom.xml index 9c3684b00120..03f37b01e97e 100644 --- a/components-starter/camel-jms-starter/pom.xml +++ b/components-starter/camel-jms-starter/pom.xml @@ -37,6 +37,14 @@ org.apache.camel camel-jms ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-jpa-starter/pom.xml b/components-starter/camel-jpa-starter/pom.xml index 60ad1378014e..ccd00a91d1c5 100644 --- a/components-starter/camel-jpa-starter/pom.xml +++ b/components-starter/camel-jpa-starter/pom.xml @@ -37,6 +37,14 @@ org.apache.camel camel-jpa ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-platform-http-starter/pom.xml b/components-starter/camel-platform-http-starter/pom.xml index dfe61f3ebb3f..38cabb97d6c0 100644 --- a/components-starter/camel-platform-http-starter/pom.xml +++ b/components-starter/camel-platform-http-starter/pom.xml @@ -50,11 +50,20 @@ ${spring-boot-version} + org.springframework.boot + spring-boot-starter-security-oauth2-client + ${spring-boot-version} + + + + + + org.springframework.boot spring-boot-starter-actuator @@ -85,6 +94,24 @@ ${spring-session-hazelcast-version} test + + org.springframework.boot + spring-boot-restclient + ${spring-boot-version} + test + + + org.springframework.boot + spring-boot-resttestclient + ${spring-boot-version} + test + + + org.springframework.boot + spring-boot-webmvc-test + ${spring-boot-version} + test + com.hazelcast hazelcast 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 a9fdbc9d0563..2f3ec376d407 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.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 d8b2d71e79d4..b3c36c98f4d0 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 0aab75a88465..000000000000 --- 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 1b64570dff6e..000000000000 --- 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. - *

- * 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 tags; - private final MBeanServer mBeanServer; - - public UndertowMetrics(XnioWorker xnioWorker, - SessionManager sessionManager, - Iterable tags) { - this(xnioWorker, sessionManager, null, tags, ManagementFactory.getPlatformMBeanServer()); - } - - public UndertowMetrics(XnioWorker xnioWorker, - SessionManager sessionManager, - Deployment deployment, - Iterable tags) { - this(xnioWorker, sessionManager, deployment, tags, ManagementFactory.getPlatformMBeanServer()); - } - - public UndertowMetrics(XnioWorker xnioWorker, - SessionManager sessionManager, - Deployment deployment, - Iterable 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 tags) { - new UndertowMetrics(xnioWorker, sessionManager, tags).bindTo(registry); - } - - public static void monitor(MeterRegistry registry, - XnioWorker xnioWorker, - SessionManager sessionManager, - Deployment deployment, - Iterable 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 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 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 9a52e0f55aac..000000000000 --- 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 fe1a23c1ecd2..000000000000 --- 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, DisposableBean { - - private final MeterRegistry meterRegistry; - private final Iterable tags; - private volatile UndertowMetrics undertowMetrics; - - public UndertowMetricsBinder(MeterRegistry meterRegistry) { - this(meterRegistry, Collections.emptyList()); - } - - public UndertowMetricsBinder(MeterRegistry meterRegistry, Iterable 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 84a0a5df88d1..0fff74df9c76 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 4d265162fc9a..75db7f055ef6 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.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 40b02e9f372a..8deeee78eab1 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.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 b6766bad7653..eac511a44fa3 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.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 003f44a548de..648c24e1e288 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.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 0cf28e0c0e65..813f0069403f 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.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 8ff89d556d2f..b22e23239065 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.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 28fa0bfa46e0..33150ca724fa 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.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 0708967e6e7e..cec45ae13754 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.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 7ec0a7383acc..348fda8a8eb6 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.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 8cc096efd5bd..a85426336246 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.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 c90ae75d25cd..e47f0b741551 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.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 b318ea593478..0c35c40b2b9c 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.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 bf369ad8f447..44285a91b64f 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.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 3d4ce2f7ec12..8278a913b474 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.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 9bcc715bfea6..e7e24343223a 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.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 086b158a9047..2bdcc56992cc 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.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 056c3fe37f2b..e659f0f74c59 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.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 195144a4c20d..6ff94a153db9 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.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 97dc2e88e027..3663a578f419 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.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 b52e764dcb4e..54dee2e94844 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.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 b69cf6ddf0e1..a3418133c26c 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.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 66cf1def32a0..63c384e75f62 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.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 9418e9a376b9..c90a390301b0 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.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 dcd9b48d5151..4eba934a1782 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.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 7cd0912e53e0..4eab98a11b64 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.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 271766ae4732..cc1d4f0a5f28 100644 --- a/components-starter/camel-pqc-starter/pom.xml +++ b/components-starter/camel-pqc-starter/pom.xml @@ -37,6 +37,14 @@ org.apache.camel camel-pqc ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-servlet-starter/pom.xml b/components-starter/camel-servlet-starter/pom.xml index 134e6e890416..095d0469bb9a 100644 --- a/components-starter/camel-servlet-starter/pom.xml +++ b/components-starter/camel-servlet-starter/pom.xml @@ -50,6 +50,11 @@ ${jakarta-servlet-api-version} provided + + org.springframework.boot + spring-boot-servlet + ${spring-boot-version} + org.springframework.boot 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 61d3c4657480..b386aaba5382 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.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 b619de66befb..052793bf5c7d 100644 --- a/components-starter/camel-spring-batch-starter/pom.xml +++ b/components-starter/camel-spring-batch-starter/pom.xml @@ -38,6 +38,14 @@ org.apache.camel camel-spring-batch ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-spring-cloud-config-starter/pom.xml b/components-starter/camel-spring-cloud-config-starter/pom.xml index 644581f7f27a..3a9f78737a58 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 @@ ch.qos.logback logback-core + + commons-logging + commons-logging + diff --git a/components-starter/camel-spring-jdbc-starter/pom.xml b/components-starter/camel-spring-jdbc-starter/pom.xml index c73f179fa676..028b0ad7932e 100644 --- a/components-starter/camel-spring-jdbc-starter/pom.xml +++ b/components-starter/camel-spring-jdbc-starter/pom.xml @@ -42,6 +42,14 @@ org.apache.camel camel-spring-jdbc ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-spring-ldap-starter/pom.xml b/components-starter/camel-spring-ldap-starter/pom.xml index 1543d009c452..d2687df4317e 100644 --- a/components-starter/camel-spring-ldap-starter/pom.xml +++ b/components-starter/camel-spring-ldap-starter/pom.xml @@ -38,6 +38,14 @@ org.apache.camel camel-spring-ldap ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-spring-rabbitmq-starter/pom.xml b/components-starter/camel-spring-rabbitmq-starter/pom.xml index fa5829622379..b3faeea4a89a 100644 --- a/components-starter/camel-spring-rabbitmq-starter/pom.xml +++ b/components-starter/camel-spring-rabbitmq-starter/pom.xml @@ -37,6 +37,14 @@ org.apache.camel camel-spring-rabbitmq ${camel-version} + + + + commons-logging + commons-logging + + + 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 19ce46c5f3ab..6b6d5e7be5ff 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 e0ca855a356b..d9e5fd6262e8 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.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 void setPrefetchCount(Integer prefetchCount) { 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 29cbc848399f..e662f6265a0a 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 Set getConvertibleTypes() { 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 Object convert( 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 3c5272c1a543..97d0f4ef702c 100644 --- a/components-starter/camel-spring-redis-starter/pom.xml +++ b/components-starter/camel-spring-redis-starter/pom.xml @@ -38,6 +38,14 @@ org.apache.camel camel-spring-redis ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-spring-starter/pom.xml b/components-starter/camel-spring-starter/pom.xml index dc6cb0acbc33..5c82b67a779e 100644 --- a/components-starter/camel-spring-starter/pom.xml +++ b/components-starter/camel-spring-starter/pom.xml @@ -38,6 +38,14 @@ org.apache.camel camel-spring ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-spring-ws-starter/pom.xml b/components-starter/camel-spring-ws-starter/pom.xml index 5fa2184649c2..88f1bcd7c6d9 100644 --- a/components-starter/camel-spring-ws-starter/pom.xml +++ b/components-starter/camel-spring-ws-starter/pom.xml @@ -43,6 +43,14 @@ org.apache.camel camel-spring-ws ${camel-version} + + + + commons-logging + commons-logging + + + diff --git a/components-starter/camel-sql-starter/pom.xml b/components-starter/camel-sql-starter/pom.xml index e0f32ecb7a12..257ed49c15d1 100644 --- a/components-starter/camel-sql-starter/pom.xml +++ b/components-starter/camel-sql-starter/pom.xml @@ -38,6 +38,14 @@ org.apache.camel camel-sql ${camel-version} + + + + commons-logging + commons-logging + + + org.springframework.boot diff --git a/components-starter/camel-undertow-spring-security-starter/pom.xml b/components-starter/camel-undertow-spring-security-starter/pom.xml index 4bd7be246ec8..32c52a31aa7d 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 @@ org.apache.camel camel-undertow-spring-security ${camel-version} + + + + commons-logging + commons-logging + + + org.apache.camel.springboot diff --git a/core/camel-spring-boot/pom.xml b/core/camel-spring-boot/pom.xml index dcbdbd07e048..18f258316bd1 100644 --- a/core/camel-spring-boot/pom.xml +++ b/core/camel-spring-boot/pom.xml @@ -95,6 +95,12 @@ + + org.springframework.boot + spring-boot-starter-restclient + ${spring-boot-version} + test + org.apache.camel camel-spring-xml 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 ae91b5590947..2705f05a5ee7 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 44d42afe3774..0b776ef4c15d 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 AsyncHealthIndicatorAutoConfiguration(HealthContributorRegistry healthCon @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 fe7d2bb6c1fe..acdc5a980e17 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.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 3df41a361d73..df64e3bab670 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.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 4d4ca4c7dfe2..cc481dacb71c 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 ac64499765c8..0f761f85c533 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 a9771efce91a..9f9ad805077f 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.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 b4a034a89394..cce7f3f36f6a 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.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 637e29fb3f7b..bd673b75683f 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.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 MetadataReader getMetadataReader(Resource resource) { } 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 37f73010514b..5b30e2fcd796 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.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 84f596ad676c..5189d301c050 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.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.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 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 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 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\"}");