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 b1fdcddb4efd9bdabe9b50a2ace4000c9572568a
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Mon Jul 29 09:33:25 2019 +0200

    Camel-JT400 - Use BindToRegistry annotation wherever possible
---
 .../apache/camel/component/jt400/Jt400SecureTestSupport.java  | 11 +++--------
 .../org/apache/camel/component/jt400/Jt400TestSupport.java    | 11 +++--------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git 
a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java
 
b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java
index 3be50eb..9cfdb25 100644
--- 
a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java
+++ 
b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java
@@ -17,6 +17,8 @@
 package org.apache.camel.component.jt400;
 
 import com.ibm.as400.access.AS400ConnectionPool;
+
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.camel.util.ObjectHelper;
@@ -30,6 +32,7 @@ import org.junit.Before;
  */
 public abstract class Jt400SecureTestSupport extends CamelTestSupport {
 
+       @BindToRegistry("mockPool")
     private AS400ConnectionPool connectionPool;
 
     protected Jt400SecureTestSupport() {
@@ -49,14 +52,6 @@ public abstract class Jt400SecureTestSupport extends 
CamelTestSupport {
         }
     }
 
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        ObjectHelper.notNull(connectionPool, "connectionPool");
-        JndiRegistry registry = super.createRegistry();
-        registry.bind("mockPool", connectionPool);
-        return registry;
-    }
-
     /**
      * Returns the mock connection pool.
      *
diff --git 
a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java
 
b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java
index b596bb2..85bca57 100644
--- 
a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java
+++ 
b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java
@@ -17,6 +17,8 @@
 package org.apache.camel.component.jt400;
 
 import com.ibm.as400.access.AS400ConnectionPool;
+
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.camel.util.ObjectHelper;
@@ -30,6 +32,7 @@ import org.junit.Before;
  */
 public abstract class Jt400TestSupport extends CamelTestSupport {
 
+       @BindToRegistry("mockPool")
     private AS400ConnectionPool connectionPool;
 
     protected Jt400TestSupport() {
@@ -49,14 +52,6 @@ public abstract class Jt400TestSupport extends 
CamelTestSupport {
         }
     }
 
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        ObjectHelper.notNull(connectionPool, "connectionPool");
-        JndiRegistry registry = super.createRegistry();
-        registry.bind("mockPool", connectionPool);
-        return registry;
-    }
-
     /**
      * Returns the mock connection pool.
      *

Reply via email to