You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/08/01 13:54:22 UTC

[camel] 01/04: CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring

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 4cc88b6e0fd7eb1ddf2e02488189ac67c2417f17
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 1 15:38:22 2019 +0200

    CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring
---
 components/camel-spring/pom.xml                                |  5 +++++
 .../java/org/apache/camel/spring/RegistryInjectionTest.java    |  5 +++--
 .../java/org/apache/camel/spring/SpringMDCTransactedTest.java  | 10 +++++++---
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/components/camel-spring/pom.xml b/components/camel-spring/pom.xml
index d0e1a6f..ee2f176 100644
--- a/components/camel-spring/pom.xml
+++ b/components/camel-spring/pom.xml
@@ -107,6 +107,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-management-impl</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
index 95e1bc1..a645792 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.spring;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -37,8 +38,8 @@ public class RegistryInjectionTest extends SpringTestSupport {
     public void testInjectedStrategy() throws Exception {
         CamelContext context = createCamelContext();
 
-        JndiRegistry jndi = context.getRegistry(JndiRegistry.class);
-        assertNotNull(jndi);
+        Registry reg = context.getRegistry(Registry.class);
+        assertNotNull(reg);
     }
 
 }
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
index 056139a..f357177 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
@@ -22,13 +22,17 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.slf4j.MDC;
 
-public class SpringMDCTransactedTest extends ContextTestSupport {
+public class SpringMDCTransactedTest extends CamelTestSupport {
 
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry result = super.createRegistry();
+	@Override
+    protected Registry createCamelRegistry() throws Exception {
+        Registry result = new SimpleRegistry();
         result.bind("NOOP-TX", new NoopPlatformTransactionManager());
         return result;
     }