You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/04/01 16:00:25 UTC

[camel] 09/09: CAMEL-17763: cleanup unused exceptions in camel-crypto

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 5e0074497034fd64f3a65bc296e2aef799c9f673
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Apr 1 16:54:01 2022 +0200

    CAMEL-17763: cleanup unused exceptions in camel-crypto
---
 .../java/org/apache/camel/component/crypto/SignatureTest.java  |  4 ++--
 .../org/apache/camel/component/crypto/SpringSignatureTest.java | 10 +++++-----
 .../camel/component/crypto/processor/SigningProcessorTest.java |  4 ++--
 .../apache/camel/converter/crypto/CryptoDataFormatTest.java    |  4 ++--
 .../org/apache/camel/converter/crypto/HMACAccumulatorTest.java |  6 +++---
 .../org/apache/camel/converter/crypto/PGPDataFormatTest.java   |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java
index eeeb474..8eaaf1f 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java
@@ -431,7 +431,7 @@ public class SignatureTest extends CamelTestSupport {
     }
 
     @BindToRegistry("myDSAPublicKey")
-    public PublicKey getDSAPublicKey() throws Exception {
+    public PublicKey getDSAPublicKey() {
         return dsaKeyPair.getPublic();
     }
 
@@ -441,7 +441,7 @@ public class SignatureTest extends CamelTestSupport {
     }
 
     @BindToRegistry("myDSAPrivateKey")
-    public PrivateKey getDSAPrivateKey() throws Exception {
+    public PrivateKey getDSAPrivateKey() {
         return dsaKeyPair.getPrivate();
     }
 
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SpringSignatureTest.java b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SpringSignatureTest.java
index 6aef7d6..1bef1e2 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SpringSignatureTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SpringSignatureTest.java
@@ -65,23 +65,23 @@ public class SpringSignatureTest extends SignatureTest {
         return cert.getPublicKey();
     }
 
-    public static PrivateKey privateRSAKey() throws Exception {
+    public static PrivateKey privateRSAKey() {
         return rsaPair.getPrivate();
     }
 
-    public static PrivateKey privateDSAKey() throws Exception {
+    public static PrivateKey privateDSAKey() {
         return dsaPair.getPrivate();
     }
 
-    public static PublicKey publicRSAKey() throws Exception {
+    public static PublicKey publicRSAKey() {
         return rsaPair.getPublic();
     }
 
-    public static PublicKey publicDSAKey() throws Exception {
+    public static PublicKey publicDSAKey() {
         return dsaPair.getPublic();
     }
 
-    public static SecureRandom random() throws Exception {
+    public static SecureRandom random() {
         return new SecureRandom();
     }
 
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/processor/SigningProcessorTest.java b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/processor/SigningProcessorTest.java
index 2bcfe74..13500be 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/processor/SigningProcessorTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/processor/SigningProcessorTest.java
@@ -39,7 +39,7 @@ public class SigningProcessorTest {
 
         DigitalSignatureProcessor processor = new DigitalSignatureProcessor(configuration) {
             @Override
-            public void process(Exchange exchange) throws Exception {
+            public void process(Exchange exchange) {
                 // Noop
             }
         };
@@ -72,7 +72,7 @@ public class SigningProcessorTest {
 
         DigitalSignatureProcessor processor = new DigitalSignatureProcessor(configuration) {
             @Override
-            public void process(Exchange exchange) throws Exception {
+            public void process(Exchange exchange) {
                 // Noop
             }
         };
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/CryptoDataFormatTest.java b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/CryptoDataFormatTest.java
index bbc5d36..0a9bc47 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/CryptoDataFormatTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/CryptoDataFormatTest.java
@@ -265,7 +265,7 @@ public class CryptoDataFormatTest extends CamelTestSupport {
                 // END SNIPPET: hmac-sha256-algorithm
             }
         }, new RouteBuilder() {
-            public void configure() throws Exception {
+            public void configure() {
                 // START SNIPPET: key-in-header
                 CryptoDataFormat cryptoFormat = new CryptoDataFormat("DES", null);
                 /**
@@ -279,7 +279,7 @@ public class CryptoDataFormatTest extends CamelTestSupport {
                         .to("mock:encrypted");
 
                 from("direct:key-in-header-decrypt").unmarshal(cryptoFormat).process(new Processor() {
-                    public void process(Exchange exchange) throws Exception {
+                    public void process(Exchange exchange) {
                         exchange.getIn().getHeaders().remove(CryptoDataFormat.KEY);
                         exchange.getMessage().copyFrom(exchange.getIn());
                     }
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HMACAccumulatorTest.java b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HMACAccumulatorTest.java
index 8b99829..f67a100 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HMACAccumulatorTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HMACAccumulatorTest.java
@@ -140,7 +140,7 @@ public class HMACAccumulatorTest {
     }
 
     @Test
-    void testBufferAdd() throws Exception {
+    void testBufferAdd() {
         CircularBuffer buffer = new CircularBuffer(payload.length * 2);
         buffer.write(payload, 0, payload.length);
         assertEquals(payload.length, buffer.availableForWrite());
@@ -151,7 +151,7 @@ public class HMACAccumulatorTest {
     }
 
     @Test
-    void testBufferDrain() throws Exception {
+    void testBufferDrain() {
         CircularBuffer buffer = new CircularBuffer(payload.length * 2);
         buffer.write(payload, 0, payload.length);
 
@@ -162,7 +162,7 @@ public class HMACAccumulatorTest {
     }
 
     @Test
-    void testBufferCompare() throws Exception {
+    void testBufferCompare() {
         CircularBuffer buffer = new CircularBuffer(payload.length * 2);
         buffer.write(new byte[payload.length >> 1], 0, payload.length >> 1);
         buffer.write(payload, 0, payload.length);
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java
index 20b2236..1162143 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java
@@ -300,7 +300,7 @@ public class PGPDataFormatTest extends AbstractPGPDataFormatTest {
     }
 
     @Test
-    void testEncryptSignWithoutCompressedDataPacket() throws Exception {
+    void testEncryptSignWithoutCompressedDataPacket() {
         assertDoesNotThrow(() -> doRoundTripEncryptionTests("direct:encrypt-sign-without-compressed-data-packet"));
         //        ByteArrayOutputStream bos = new ByteArrayOutputStream();
         //