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/07/29 07:01:43 UTC
[camel] 01/02: Camel-Jsch - Use BindToRegistry annotation wherever
possible
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 78b38b9c63b7c66f9adf4fe1ff82afd2125a2a4d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Jul 29 09:00:56 2019 +0200
Camel-Jsch - Use BindToRegistry annotation wherever possible
---
.../org/apache/camel/component/scp/ScpSimpleProduceTest.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpSimpleProduceTest.java b/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpSimpleProduceTest.java
index 77f236d..9caca8c 100644
--- a/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpSimpleProduceTest.java
+++ b/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpSimpleProduceTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.scp;
import java.io.File;
import java.nio.file.Files;
+import org.apache.camel.BindToRegistry;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.JndiRegistry;
@@ -140,11 +141,9 @@ public class ScpSimpleProduceTest extends ScpServerTestSupport {
assertMockEndpointsSatisfied();
}
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
+ @BindToRegistry("privKey")
+ public byte[] loadPrivateKey() throws Exception {
byte[] privKey = Files.readAllBytes(new File("src/test/resources/camel-key.priv").toPath());
- registry.bind("privKey", privKey);
- return registry;
+ return privKey;
}
}