You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/11/05 10:50:04 UTC

[camel-spring-boot] branch main updated: Cleanup

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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new 924b1d6  Cleanup
924b1d6 is described below

commit 924b1d688123f0ea5052ca3b091dd3c9dfdc9759
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Nov 5 11:30:23 2021 +0100

    Cleanup
    
    CAMEL-17169: camel-spring-boot management endpoints to work with latest spring boot 2.x style.
    
    CAMEL-17169: camel-spring-boot management endpoints to work with latest spring boot 2.x style.
    
    CAMEL-17169: camel-spring-boot management endpoints to work with latest spring boot 2.x style.
---
 core/camel-spring-boot/pom.xml                     |   5 -
 .../src/main/docs/spring-boot.adoc                 |   4 +-
 .../src/main/docs/spring-boot.json                 |  14 +--
 .../endpoint/CamelRouteControllerEndpoint.java     |   4 +-
 ...elRouteControllerEndpointAutoConfiguration.java |   6 +-
 .../boot/actuate/endpoint/CamelRoutesEndpoint.java | 119 +++++++--------------
 .../CamelRoutesEndpointAutoConfiguration.java      |  13 +--
 .../endpoint/CamelRoutesEndpointProperties.java    |  15 +--
 .../additional-spring-configuration-metadata.json  |  18 ----
 .../src/main/resources/META-INF/spring.factories   |   2 +
 .../CamelRouteControllerEndpointEnabledTest.java   |   4 +-
 ...erEndpointGloballyDisabledAndReenabledTest.java |  14 +--
 .../endpoint/CamelRouteControllerEndpointTest.java |  15 ++-
 .../endpoint/CamelRoutesEndpointEnabledTest.java   |   3 +-
 ... CamelRoutesEndpointReadOnlyOperationTest.java} |  16 +--
 .../CamelRoutesEndpointWriteOperationTest.java     |   3 +-
 16 files changed, 86 insertions(+), 169 deletions(-)

diff --git a/core/camel-spring-boot/pom.xml b/core/camel-spring-boot/pom.xml
index 70a6b93..308a1ad 100644
--- a/core/camel-spring-boot/pom.xml
+++ b/core/camel-spring-boot/pom.xml
@@ -121,11 +121,6 @@
             </exclusions>
             <scope>test</scope>
         </dependency>
-      <!--   <dependency>
-            <groupId>org.junit.vintage</groupId>
-            <artifactId>junit-vintage-engine</artifactId>
-            <scope>test</scope>
-        </dependency> -->
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-management</artifactId>
diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.adoc b/core/camel-spring-boot/src/main/docs/spring-boot.adoc
index 43a1fd3..76470ac 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.adoc
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.adoc
@@ -264,11 +264,9 @@ The component supports 173 options, which are listed below.
 | *camel.threadpool.rejected-policy* | Sets the default handler for tasks which cannot be executed by the thread pool. |  | ThreadPoolRejectedPolicy
 | *camel.threadpool.time-unit* | Sets the default time unit used for keep alive time |  | TimeUnit
 | *management.endpoint.camelroutecontroller.cache.time-to-live* | Maximum time that a response can be cached. | 0ms | Duration
-| *management.endpoint.camelroutecontroller.enabled* | To turn on or off information about Camel Route Controller via actuator endpoint. | true | Boolean
+| *management.endpoint.camelroutecontroller.enabled* | Whether to enable the camelroutecontroller endpoint. | true | Boolean
 | *management.endpoint.camelroutes.cache.time-to-live* | Maximum time that a response can be cached. | 0ms | Duration
-| *management.endpoint.camelroutes.enabled* | To turn on or off information about Camel Routes via actuator endpoint. | true | Boolean
 | *management.endpoint.camelroutes.enabled* | Whether to enable the camelroutes endpoint. | true | Boolean
-| *management.endpoint.camelroutes.enabled* |  | false | Boolean
 | *management.endpoint.camelroutes.read-only* | Whether Camel Routes actuator is in read-only mode. If not in read-only mode then operations to start/stop routes would be enabled. | true | Boolean
 | *management.info.camel.enabled* | Whether to enable Camel info. | true | Boolean
 | *camel.springboot.route-controller-logging-level* | *Deprecated* Sets the logging level used for logging route activity (such as starting and stopping routes). The default logging level is DEBUG. |  | LoggingLevel
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 a43fd39..e829082 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -1243,7 +1243,7 @@
     {
       "name": "management.endpoint.camelroutecontroller.enabled",
       "type": "java.lang.Boolean",
-      "description": "To turn on or off information about Camel Route Controller via actuator endpoint.",
+      "description": "Whether to enable the camelroutecontroller endpoint.",
       "sourceType": "org.apache.camel.spring.boot.actuate.endpoint.CamelRouteControllerEndpoint",
       "defaultValue": true
     },
@@ -1257,23 +1257,11 @@
     {
       "name": "management.endpoint.camelroutes.enabled",
       "type": "java.lang.Boolean",
-      "description": "To turn on or off information about Camel Routes via actuator endpoint.",
-      "defaultValue": true
-    },
-    {
-      "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
     },
     {
-      "name": "management.endpoint.camelroutes.enabled",
-      "type": "java.lang.Boolean",
-      "sourceType": "org.apache.camel.spring.boot.actuate.endpoint.CamelRoutesEndpointProperties",
-      "defaultValue": false
-    },
-    {
       "name": "management.endpoint.camelroutes.read-only",
       "type": "java.lang.Boolean",
       "description": "Whether Camel Routes actuator is in read-only mode. If not in read-only mode then operations to start\/stop routes would be enabled.",
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpoint.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpoint.java
index c6d3f00..e0c1123 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpoint.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpoint.java
@@ -27,9 +27,9 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
 import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
 
 /*
- * {@link Endpoint} to expose {@link RouteController} information.
+ * Spring Boot Management Endpoint to expose Camel RouteController information.
  */
-@Endpoint(id = "camelroutecontroller", enableByDefault = true)
+@Endpoint(id = "camelroutecontroller")
 public class CamelRouteControllerEndpoint {
 
     private CamelContext camelContext;
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointAutoConfiguration.java
index 0b2cccd..644f1cd 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointAutoConfiguration.java
@@ -18,6 +18,7 @@ package org.apache.camel.spring.boot.actuate.endpoint;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
 import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -28,11 +29,12 @@ import org.springframework.context.annotation.Configuration;
 /*
  * Auto configuration for the {@link CamelRouteControllerEndpoint}.
  */
-@Configuration
-@ConditionalOnClass({CamelRouteControllerEndpoint.class})
+@Configuration(proxyBeanMethods = false)
+@ConditionalOnAvailableEndpoint(endpoint = CamelRouteControllerEndpoint.class)
 @ConditionalOnBean(CamelAutoConfiguration.class)
 @AutoConfigureAfter(CamelAutoConfiguration.class)
 public class CamelRouteControllerEndpointAutoConfiguration {
+
     @Bean
     @ConditionalOnClass(CamelContext.class)
     @ConditionalOnMissingBean
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
index 1b2c34c..1db4582 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
@@ -26,14 +26,11 @@ import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.Route;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.StatefulService;
 import org.apache.camel.api.management.ManagedCamelContext;
 import org.apache.camel.api.management.mbean.ManagedRouteMBean;
-import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.spi.RouteError;
 import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
 import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
 import org.springframework.boot.actuate.endpoint.annotation.Selector;
@@ -44,24 +41,19 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 
-
 /*
- * {@link Endpoint} to expose {@link org.apache.camel.Route} information.
+ * Spring Boot Management Endpoint to expose Camel Route information.
  */
-@Endpoint(id = "camelroutes", enableByDefault = true)
+@Endpoint(id = "camelroutes")
 public class CamelRoutesEndpoint {
 
     private CamelContext camelContext;
-    private static ExtendedCamelContext extendedContext;
-    private static ManagedCamelContext mcontext;
-    private static DefaultCamelContext dcontext; 
+    private ManagedCamelContext managedCamelContext;
     private CamelRoutesEndpointProperties properties;
 
     public CamelRoutesEndpoint(CamelContext camelContext, CamelRoutesEndpointProperties properties) {
         this.camelContext = camelContext;
-        this.extendedContext = camelContext.getExtension(ExtendedCamelContext.class);
-        this.mcontext = camelContext.getExtension(ManagedCamelContext.class);;
-        this.dcontext = camelContext.getExtension(DefaultCamelContext.class);
+        this.managedCamelContext = camelContext.getExtension(ManagedCamelContext.class);
         this.properties = properties;
     }
 
@@ -73,12 +65,12 @@ public class CamelRoutesEndpoint {
     @ReadOperation
     public Object doReadAction(@Selector String id, @Selector ReadAction action) {
         switch (action) {
-        case DETAIL:
-            return getRouteDetailsInfo(id);
-        case INFO:
-            return getRouteInfo(id);
-        default:
-            throw new IllegalArgumentException("Unsupported read action " + action);
+            case DETAIL:
+                return getRouteDetailsInfo(id);
+            case INFO:
+                return getRouteInfo(id);
+            default:
+                throw new IllegalArgumentException("Unsupported read action " + action);
         }
     }
 
@@ -89,29 +81,29 @@ public class CamelRoutesEndpoint {
         }
 
         switch (action) {
-        case STOP:
-            stopRoute(
-                    id,
-                    Optional.ofNullable(timeInfo).flatMap(ti -> Optional.ofNullable(ti.getTimeout())),
-                    Optional.of(TimeUnit.SECONDS),
-                    Optional.ofNullable(timeInfo).flatMap(ti -> Optional.ofNullable(ti.getAbortAfterTimeout())));
-            break;
-        case START:
-            startRoute(id);
-            break;
-        case RESET:
-            resetRoute(id);
-            break;
-        case SUSPEND:
-            suspendRoute(id,
-                    Optional.ofNullable(timeInfo).flatMap(ti -> Optional.ofNullable(ti.getTimeout())),
-                    Optional.of(TimeUnit.SECONDS));
-            break;
-        case RESUME:
-            resumeRoute(id);
-            break;
-        default:
-            throw new IllegalArgumentException("Unsupported write action " + action);
+            case STOP:
+                stopRoute(
+                        id,
+                        Optional.ofNullable(timeInfo).flatMap(ti -> Optional.ofNullable(ti.getTimeout())),
+                        Optional.of(TimeUnit.SECONDS),
+                        Optional.ofNullable(timeInfo).flatMap(ti -> Optional.ofNullable(ti.getAbortAfterTimeout())));
+                break;
+            case START:
+                startRoute(id);
+                break;
+            case RESET:
+                resetRoute(id);
+                break;
+            case SUSPEND:
+                suspendRoute(id,
+                        Optional.ofNullable(timeInfo).flatMap(ti -> Optional.ofNullable(ti.getTimeout())),
+                        Optional.of(TimeUnit.SECONDS));
+                break;
+            case RESUME:
+                resumeRoute(id);
+                break;
+            default:
+                throw new IllegalArgumentException("Unsupported write action " + action);
         }
     }
 
@@ -149,7 +141,7 @@ public class CamelRoutesEndpoint {
 
     private void resetRoute(String id) {
         try {
-            ManagedRouteMBean managedRouteMBean = mcontext.getManagedRoute(id, ManagedRouteMBean.class);
+            ManagedRouteMBean managedRouteMBean = managedCamelContext.getManagedRoute(id, ManagedRouteMBean.class);
             if (managedRouteMBean != null) {
                 managedRouteMBean.reset(true);
             }
@@ -198,17 +190,11 @@ public class CamelRoutesEndpoint {
     public static class RouteEndpointInfo {
 
         private final String id;
-        
         private final String group;
-
         private final Map<String, Object> properties;
-
         private final String description;
-
         private final String uptime;
-
         private final long uptimeMillis;
-
         private final String status;
 
         public RouteEndpointInfo(Route route) {
@@ -234,7 +220,7 @@ public class CamelRoutesEndpoint {
         public String getId() {
             return id;
         }
-        
+
         public String getGroup() {
             return group;
         }
@@ -271,9 +257,9 @@ public class CamelRoutesEndpoint {
 
         public RouteDetailsEndpointInfo(final CamelContext camelContext, final Route route) {
             super(route);
-
             if (camelContext.getManagementStrategy().getManagementAgent() != null) {
-               this.routeDetails = new RouteDetails(mcontext.getManagedRoute(route.getId(), ManagedRouteMBean.class));
+                ManagedCamelContext mcc = camelContext.getExtension(ManagedCamelContext.class);
+                this.routeDetails = new RouteDetails(mcc.getManagedRoute(route.getId(), ManagedRouteMBean.class));
             }
         }
 
@@ -281,55 +267,29 @@ public class CamelRoutesEndpoint {
         static class RouteDetails {
 
             private long deltaProcessingTime;
-
             private long exchangesInflight;
-
             private long exchangesTotal;
-
             private long externalRedeliveries;
-
             private long failuresHandled;
-
             private String firstExchangeCompletedExchangeId;
-
             private Date firstExchangeCompletedTimestamp;
-
             private String firstExchangeFailureExchangeId;
-
             private Date firstExchangeFailureTimestamp;
-
             private String lastExchangeCompletedExchangeId;
-
             private Date lastExchangeCompletedTimestamp;
-
             private String lastExchangeFailureExchangeId;
-
             private Date lastExchangeFailureTimestamp;
-
             private long lastProcessingTime;
-
             private String load01;
-
             private String load05;
-
             private String load15;
-
             private long maxProcessingTime;
-
             private long meanProcessingTime;
-
             private long minProcessingTime;
-
             private Long oldestInflightDuration;
-
             private String oldestInflightExchangeId;
-
             private long redeliveries;
-
             private long totalProcessingTime;
-
-            private RouteError lastError;
-
             private boolean hasRouteController;
 
             RouteDetails(ManagedRouteMBean managedRoute) {
@@ -358,7 +318,6 @@ public class CamelRoutesEndpoint {
                     this.oldestInflightExchangeId = managedRoute.getOldestInflightExchangeId();
                     this.redeliveries = managedRoute.getRedeliveries();
                     this.totalProcessingTime = managedRoute.getTotalProcessingTime();
-                    //this.lastError = managedRoute.getLastError();
                     this.hasRouteController = managedRoute.getHasRouteController();
                 } catch (Exception e) {
                     // Ignore
@@ -461,10 +420,6 @@ public class CamelRoutesEndpoint {
                 return totalProcessingTime;
             }
 
-            public RouteError getLastError() {
-                return lastError;
-            }
-
             public boolean getHasRouteController() {
                 return hasRouteController;
             }
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointAutoConfiguration.java
index 24c9131..b29c2b5 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointAutoConfiguration.java
@@ -18,6 +18,7 @@ package org.apache.camel.spring.boot.actuate.endpoint;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
 import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -29,23 +30,17 @@ import org.springframework.context.annotation.Configuration;
 /*
  * Auto configuration for the {@link CamelRoutesEndpoint}.
  */
-@Configuration
+@Configuration(proxyBeanMethods = false)
 @EnableConfigurationProperties({ CamelRoutesEndpointProperties.class })
-@ConditionalOnClass({CamelRoutesEndpoint.class})
+@ConditionalOnAvailableEndpoint(endpoint = CamelRoutesEndpoint.class)
 @ConditionalOnBean(CamelAutoConfiguration.class)
 @AutoConfigureAfter(CamelAutoConfiguration.class)
 public class CamelRoutesEndpointAutoConfiguration {
 
-    private CamelRoutesEndpointProperties properties;
-
-    public CamelRoutesEndpointAutoConfiguration(CamelRoutesEndpointProperties properties) {
-        this.properties = properties;
-    }
-
     @Bean
     @ConditionalOnClass(CamelContext.class)
     @ConditionalOnMissingBean
-    public CamelRoutesEndpoint camelEndpoint(CamelContext camelContext) {
+    public CamelRoutesEndpoint camelEndpoint(CamelContext camelContext, CamelRoutesEndpointProperties properties) {
         return new CamelRoutesEndpoint(camelContext, properties);
     }
 
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointProperties.java
index 21d447b..271f2b8 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointProperties.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointProperties.java
@@ -21,8 +21,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
 @ConfigurationProperties("management.endpoint.camelroutes")
 public class CamelRoutesEndpointProperties {
 
+    /**
+     * Whether Camel Routes actuator is in read-only mode.
+     * If not in read-only mode then operations to start/stop routes would be enabled.
+     */
     private boolean readOnly = true;
-    private boolean enabled = false;
 
     public boolean isReadOnly() {
         return readOnly;
@@ -32,14 +35,4 @@ public class CamelRoutesEndpointProperties {
         this.readOnly = readOnly;
     }
     
-    public boolean isEnabled() {
-        return enabled;
-    }
-    
-    public void setEnabled(boolean enabled) {
-        this.enabled = enabled;
-    }
-    
-    
-
 }
diff --git a/core/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/core/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
index cf56bd1..d1fb7f9 100644
--- a/core/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+++ b/core/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -1,24 +1,6 @@
 {
   "properties": [
     {
-      "name": "management.endpoint.camelroutes.read-only",
-      "type": "java.lang.Boolean",
-      "description": "Whether Camel Routes actuator is in read-only mode. If not in read-only mode then operations to start/stop routes would be enabled.",
-      "defaultValue": true
-    },
-    {
-      "name": "management.endpoint.camelroutes.enabled",
-      "type": "java.lang.Boolean",
-      "description": "To turn on or off information about Camel Routes via actuator endpoint.",
-      "defaultValue": true
-    },
-    {
-      "name": "management.endpoint.camelroutecontroller.enabled",
-      "type": "java.lang.Boolean",
-      "description": "To turn on or off information about Camel Route Controller via actuator endpoint.",
-      "defaultValue": true
-    },
-    {
       "name": "management.info.camel.enabled",
       "type": "java.lang.Boolean",
       "description": "Whether to enable Camel info.",
diff --git a/core/camel-spring-boot/src/main/resources/META-INF/spring.factories b/core/camel-spring-boot/src/main/resources/META-INF/spring.factories
index 38f8a24..ba07de0 100644
--- a/core/camel-spring-boot/src/main/resources/META-INF/spring.factories
+++ b/core/camel-spring-boot/src/main/resources/META-INF/spring.factories
@@ -33,6 +33,8 @@
 
 org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
 org.apache.camel.spring.boot.CamelAutoConfiguration,\
+org.apache.camel.spring.boot.actuate.endpoint.CamelRouteControllerEndpointAutoConfiguration,\
+org.apache.camel.spring.boot.actuate.endpoint.CamelRoutesEndpointAutoConfiguration,\
 org.apache.camel.spring.boot.actuate.health.CamelHealthCheckAutoConfiguration,\
 org.apache.camel.spring.boot.actuate.info.CamelInfoAutoConfiguration,\
 org.apache.camel.spring.boot.cloud.CamelCloudAutoConfiguration,\
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointEnabledTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointEnabledTest.java
index 8fd384c..2cba0ca 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointEnabledTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointEnabledTest.java
@@ -36,11 +36,11 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 @SpringBootApplication
 @SpringBootTest(
     classes = {CamelAutoConfiguration.class, CamelRouteControllerEndpointAutoConfiguration.class, ActuatorTestRoute.class},
-    properties = {"management.endpoint.camelroutecontroller.enabled=true"}
+    properties = {"management.endpoints.web.exposure.include=camelroutecontroller"}
 )
 public class CamelRouteControllerEndpointEnabledTest {
 
-    @Autowired(required = true)
+    @Autowired
     CamelRouteControllerEndpoint routeControllerEndpoint;
 
     @Autowired
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointGloballyDisabledAndReenabledTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointGloballyDisabledAndReenabledTest.java
index 5c60ef2..33aadfa 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointGloballyDisabledAndReenabledTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointGloballyDisabledAndReenabledTest.java
@@ -37,15 +37,16 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 @SpringBootTest(
     classes = {CamelAutoConfiguration.class, CamelRoutesEndpointAutoConfiguration.class,
                CamelRouteControllerEndpointAutoConfiguration.class, ActuatorTestRoute.class},
-    properties = {"management.endpoints.enabled-by-default = true",
-                  "management.endpoint.camelroutecontroller.enabled = true"}
+    properties = {"management.endpoints.web.exposure.include=*",
+                  "management.endpoint.camelroute.enabled=true",
+                  "management.endpoint.camelroutecontroller.enabled=false"}
 )
 public class CamelRouteControllerEndpointGloballyDisabledAndReenabledTest {
 
-    @Autowired
+    @Autowired(required = false)
     CamelRouteControllerEndpoint routeControllerEndpoint;
 
-    @Autowired
+    @Autowired(required = false)
     CamelRoutesEndpoint routesEndpoint;
 
     @Autowired
@@ -53,9 +54,10 @@ public class CamelRouteControllerEndpointGloballyDisabledAndReenabledTest {
 
     @Test
     public void testRoutesEndpointPresent() throws Exception {
-
+        // routes is enabled
         Assertions.assertNotNull(routesEndpoint);
-        Assertions.assertNotNull(routeControllerEndpoint);
+        // controller is disabled
+        Assertions.assertNull(routeControllerEndpoint);
     }
 
 }
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointTest.java
index c9bbd05..5e6e739 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointTest.java
@@ -36,7 +36,11 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 @CamelSpringBootTest
 @EnableAutoConfiguration
 @SpringBootApplication
-@SpringBootTest(classes = {CamelAutoConfiguration.class, CamelRouteControllerEndpointAutoConfiguration.class, ActuatorTestRoute.class})
+@SpringBootTest(
+        classes = {CamelAutoConfiguration.class, CamelRouteControllerEndpointAutoConfiguration.class,
+                CamelRoutesEndpointAutoConfiguration.class, ActuatorTestRoute.class},
+        properties = {"management.endpoints.web.exposure.include=*",
+                      "camel.springboot.routeControllerSuperviseEnabled=true"})
 public class CamelRouteControllerEndpointTest {
 
     @Autowired
@@ -48,13 +52,8 @@ public class CamelRouteControllerEndpointTest {
     @Test
     public void testRouteControllerEndpoint() throws Exception {
         List<String> routesId = endpoint.getControlledRoutes();
-
-        Assertions.assertNotNull(routesId);
-        /* FIXME DefaultRouteController returns empty list while it does control any route...
-        assertFalse(routesId.isEmpty());
-        assertEquals(routesId.size(), camelContext.getRoutes().size());
-        assertTrue(routesId.stream().anyMatch(r -> "foo-route".equals(r)));
-        */
+        Assertions.assertTrue(routesId.size() > 0);
+        Assertions.assertTrue(routesId.contains("foo-route"));
     }
 
 }
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointEnabledTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointEnabledTest.java
index cd4b043..c910cee 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointEnabledTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointEnabledTest.java
@@ -36,7 +36,8 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 @SpringBootApplication
 @SpringBootTest(
     classes = {CamelAutoConfiguration.class, CamelRoutesEndpointAutoConfiguration.class, ActuatorTestRoute.class},
-    properties = {"management.endpoint.camelroutes.enabled = true"}
+        properties = {"management.endpoints.web.exposure.include=*",
+                "management.endpoint.camelroutes.enabled = true"}
 )
 public class CamelRoutesEndpointEnabledTest {
 
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointWriteOperationTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointReadOnlyOperationTest.java
similarity index 83%
copy from core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointWriteOperationTest.java
copy to core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointReadOnlyOperationTest.java
index a392a18..dc83ee7 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointWriteOperationTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointReadOnlyOperationTest.java
@@ -22,6 +22,7 @@ import org.apache.camel.impl.engine.AbstractCamelContext;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.actuate.endpoint.CamelRoutesEndpoint.TimeInfo;
 import org.apache.camel.spring.boot.actuate.endpoint.CamelRoutesEndpoint.WriteAction;
+import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,7 +30,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.annotation.DirtiesContext;
-import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 
 /*
  * Test for the {@link CamelRoutesEndpoint} actuator endpoint.
@@ -40,8 +40,9 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 @SpringBootApplication
 @SpringBootTest(
     classes = {CamelAutoConfiguration.class, CamelRoutesEndpointAutoConfiguration.class, ActuatorTestRoute.class},
-    properties = {"management.endpoint.camelroutes.read-only = false"})
-public class CamelRoutesEndpointWriteOperationTest {
+    properties = {"management.endpoints.web.exposure.include=*",
+            "management.endpoint.camelroutes.read-only = true"})
+public class CamelRoutesEndpointReadOnlyOperationTest {
 
     @Autowired
     CamelRoutesEndpoint endpoint;
@@ -57,8 +58,11 @@ public class CamelRoutesEndpointWriteOperationTest {
         TimeInfo timeInfo = new TimeInfo();
         timeInfo.setAbortAfterTimeout(true);
         timeInfo.setTimeout(10L);
-        endpoint.doWriteAction("foo-route", WriteAction.STOP, timeInfo);
-        status = acontext.getRouteStatus("foo-route");
-        Assertions.assertTrue(status.isStopped());
+        try {
+            endpoint.doWriteAction("foo-route", WriteAction.STOP, timeInfo);
+            Assertions.fail("Should not allow write");
+        } catch (IllegalArgumentException e) {
+            Assertions.assertEquals("Read only: write action STOP is not allowed", e.getMessage());
+        }
     }
 }
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointWriteOperationTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointWriteOperationTest.java
index a392a18..eb8cba7 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointWriteOperationTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointWriteOperationTest.java
@@ -40,7 +40,8 @@ import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
 @SpringBootApplication
 @SpringBootTest(
     classes = {CamelAutoConfiguration.class, CamelRoutesEndpointAutoConfiguration.class, ActuatorTestRoute.class},
-    properties = {"management.endpoint.camelroutes.read-only = false"})
+    properties = {"management.endpoints.web.exposure.include=*",
+            "management.endpoint.camelroutes.read-only = false"})
 public class CamelRoutesEndpointWriteOperationTest {
 
     @Autowired