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/02 12:49:54 UTC
[camel] 01/04: CAMEL-13801 - camel3 - Use @BindToRegistry wherever
possible, Camel-XMLSecurity
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 c37c326640db0e83fabc8aa1ae6aae6ec1c2573c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Aug 2 14:39:45 2019 +0200
CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-XMLSecurity
---
.../org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java | 6 ++++--
.../apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java | 6 ++++--
.../camel/component/xmlsecurity/SignatureDigestMethodTest.java | 6 ++++--
.../apache/camel/component/xmlsecurity/SpringXmlSignatureTest.java | 6 ++++--
.../camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java | 6 ++++--
.../org/apache/camel/component/xmlsecurity/XmlSignatureTest.java | 6 ++++--
6 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java
index 4d7e394..51d46f7 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java
@@ -37,6 +37,8 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.xmlsecurity.api.KeyAccessor;
import org.apache.camel.component.xmlsecurity.util.SameDocumentUriDereferencer;
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.apache.camel.test.junit4.TestSupport;
import org.junit.Before;
@@ -84,8 +86,8 @@ public class ECDSASignatureTest extends CamelTestSupport {
}
@Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
+ protected Registry createCamelRegistry() throws Exception {
+ Registry registry = new SimpleRegistry();
// This test fails with the IBM JDK
if (canTest) {
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java
index ec079a5..6b171f3 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java
@@ -72,6 +72,8 @@ import org.apache.camel.component.xmlsecurity.util.ValidationFailedHandlerIgnore
import org.apache.camel.component.xmlsecurity.util.XmlSignature2Message2MessageWithTimestampProperty;
import org.apache.camel.impl.DefaultCamelContext;
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.apache.camel.test.junit4.TestSupport;
import org.junit.Before;
@@ -110,8 +112,8 @@ public class SignatureAlgorithmTest extends CamelTestSupport {
}
@Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
+ protected Registry createCamelRegistry() throws Exception {
+ Registry registry = new SimpleRegistry();
Key secretKey = getSecretKey("testkey".getBytes("ASCII"));
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java
index 0f5a7b4..78b11c5 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java
@@ -71,6 +71,8 @@ import org.apache.camel.component.xmlsecurity.util.ValidationFailedHandlerIgnore
import org.apache.camel.component.xmlsecurity.util.XmlSignature2Message2MessageWithTimestampProperty;
import org.apache.camel.impl.DefaultCamelContext;
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.apache.camel.test.junit4.TestSupport;
import org.junit.Before;
@@ -108,8 +110,8 @@ public class SignatureDigestMethodTest extends CamelTestSupport {
}
@Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
+ protected Registry createCamelRegistry() throws Exception {
+ Registry registry = new SimpleRegistry();
registry.bind("accessor", getKeyAccessor(keyPair.getPrivate()));
registry.bind("canonicalizationMethod1", getCanonicalizationMethod());
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SpringXmlSignatureTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SpringXmlSignatureTest.java
index fd36e3b..6f94b84 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SpringXmlSignatureTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SpringXmlSignatureTest.java
@@ -31,7 +31,9 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.xmlsecurity.api.KeyAccessor;
import org.apache.camel.component.xmlsecurity.api.XmlSignatureHelper;
import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
import org.apache.camel.spring.SpringCamelContext;
+import org.apache.camel.support.SimpleRegistry;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -63,8 +65,8 @@ public class SpringXmlSignatureTest extends XmlSignatureTest {
}
@Override
- protected JndiRegistry createRegistry() throws Exception {
- return super.createRegistry();
+ protected Registry createCamelRegistry() throws Exception {
+ return new SimpleRegistry();
}
@Override
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
index e4447c8..89cafd3 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
@@ -66,6 +66,8 @@ import org.apache.camel.component.xmlsecurity.api.XmlSignatureHelper;
import org.apache.camel.component.xmlsecurity.api.XmlSignatureProperties;
import org.apache.camel.component.xmlsecurity.util.TestKeystore;
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.apache.camel.test.junit4.TestSupport;
import org.junit.Before;
@@ -95,8 +97,8 @@ public class XAdESSignaturePropertiesTest extends CamelTestSupport {
}
@Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
+ protected Registry createCamelRegistry() throws Exception {
+ Registry registry = new SimpleRegistry();
registry.bind("keyAccessorDefault", TestKeystore.getKeyAccessor("bob"));
registry.bind("xmlSignatureProperties", getXmlSignatureProperties("bob"));
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java
index fe68dd2..d4c0b12 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java
@@ -98,6 +98,8 @@ import org.apache.camel.component.xmlsecurity.util.ValidationFailedHandlerIgnore
import org.apache.camel.component.xmlsecurity.util.XmlSignature2Message2MessageWithTimestampProperty;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
import org.apache.camel.support.processor.validation.SchemaValidationException;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.camel.test.junit4.TestSupport;
@@ -120,8 +122,8 @@ public class XmlSignatureTest extends CamelTestSupport {
}
@Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
+ protected Registry createCamelRegistry() throws Exception {
+ Registry registry = new SimpleRegistry();
registry.bind("accessor", getKeyAccessor(keyPair.getPrivate()));
registry.bind("canonicalizationMethod1", getCanonicalizationMethod());