This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 266fb3fad20b2d39ca57e5a53058e3b838822042 Author: Andrea Cosentino <[email protected]> AuthorDate: Fri Aug 2 15:06:04 2019 +0200 CAMEL-13801 - Fixed CS for Camel-zookeeper --- ...erServiceRegistrationWithServiceComponentTest.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java index ca131f8..1bf1b55 100644 --- a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java +++ b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java @@ -19,6 +19,7 @@ package org.apache.camel.component.zookeeper.cloud; import java.util.Collections; import java.util.Map; +import org.apache.camel.BindToRegistry; import org.apache.camel.RoutesBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.service.ServiceComponent; @@ -26,28 +27,20 @@ import org.apache.camel.impl.JndiRegistry; public class ZooKeeperServiceRegistrationWithServiceComponentTest extends ZooKeeperServiceRegistrationTestBase { + @BindToRegistry("service") + private ServiceComponent service = new ServiceComponent(); + protected Map<String, String> getMetadata() { return Collections.singletonMap("service.type", "zookeeper"); } @Override - protected JndiRegistry createRegistry() throws Exception { - JndiRegistry registry = super.createRegistry(); - registry.bind("service", new ServiceComponent()); - - return registry; - } - - @Override protected RoutesBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { - fromF("service:%s:jetty:http://0.0.0.0:%d/service/endpoint?service.type=zookeeper", SERVICE_NAME, SERVICE_PORT) - .routeId(SERVICE_ID) - .routeGroup(SERVICE_NAME) - .noAutoStartup() - .to("log:service-registry?level=INFO"); + fromF("service:%s:jetty:http://0.0.0.0:%d/service/endpoint?service.type=zookeeper", SERVICE_NAME, SERVICE_PORT).routeId(SERVICE_ID).routeGroup(SERVICE_NAME) + .noAutoStartup().to("log:service-registry?level=INFO"); } }; }
