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

ffang 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 01e891a  [CAMEL-17494]camel-spring-boot: ServiceRegistry not started
01e891a is described below

commit 01e891abf9314d778fdeead4178219c9a7944b75
Author: Freeman Fang <freeman.f...@gmail.com>
AuthorDate: Mon Jan 17 10:40:57 2022 -0500

    [CAMEL-17494]camel-spring-boot: ServiceRegistry not started
---
 .../component/consul/springboot/cloud/ConsulServiceRegistryIT.java   | 5 +++--
 .../zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java     | 4 ++--
 .../zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java    | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/components-starter/camel-consul-starter/src/test/java/org/apache/camel/component/consul/springboot/cloud/ConsulServiceRegistryIT.java
 
b/components-starter/camel-consul-starter/src/test/java/org/apache/camel/component/consul/springboot/cloud/ConsulServiceRegistryIT.java
index 68c4b7c..8ca8db2 100644
--- 
a/components-starter/camel-consul-starter/src/test/java/org/apache/camel/component/consul/springboot/cloud/ConsulServiceRegistryIT.java
+++ 
b/components-starter/camel-consul-starter/src/test/java/org/apache/camel/component/consul/springboot/cloud/ConsulServiceRegistryIT.java
@@ -83,10 +83,11 @@ public class ConsulServiceRegistryIT {
                     assertThat(context).hasSingleBean(ServiceRegistry.class);
 
                     final CamelContext camelContext =  
context.getBean(CamelContext.class);
-                    final ServiceRegistry serviceRegistry = 
camelContext.hasService(ServiceRegistry.class);
+                    final ServiceRegistry serviceRegistry = 
context.getBean(ServiceRegistry.class);
+                    
 
                     assertThat(serviceRegistry).isNotNull();
-
+                    serviceRegistry.start();
                     serviceRegistry.register(
                         DefaultServiceDefinition.builder()
                             .withHost(SERVICE_HOST)
diff --git 
a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java
 
b/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java
index 92e9be5..1103cb2 100644
--- 
a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java
+++ 
b/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java
@@ -87,10 +87,10 @@ public class ZooKeeperServiceRegistryTest {
                         
assertThat(context).hasSingleBean(ServiceRegistry.class);
 
                         final CamelContext camelContext = 
context.getBean(CamelContext.class);
-                        final ServiceRegistry serviceRegistry = 
camelContext.hasService(ServiceRegistry.class);
+                        final ServiceRegistry serviceRegistry = 
context.getBean(ServiceRegistry.class);
 
                         assertThat(serviceRegistry).isNotNull();
-
+                        serviceRegistry.start();
                         serviceRegistry.register(
                             DefaultServiceDefinition.builder()
                                 .withHost(SERVICE_HOST)
diff --git 
a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
 
b/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
index 14ecbea..9e4d121 100644
--- 
a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
+++ 
b/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
@@ -64,9 +64,9 @@ public class ZooKeeperClusterServiceTest {
                         
assertThat(context).hasSingleBean(CamelClusterService.class);
 
                         final CamelContext camelContext = 
context.getBean(CamelContext.class);
-                        final CamelClusterService clusterService = 
camelContext.hasService(CamelClusterService.class);
-
+                        final CamelClusterService clusterService = 
context.getBean(CamelClusterService.class);
                         assertThat(clusterService).isNotNull();
+                        clusterService.start();
                         
assertThat(clusterService).isInstanceOf(ZooKeeperClusterService.class);
                     }
                 );

Reply via email to