[camel-kafka-connector] branch master updated (7502299 -> 75110df)

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] branch master updated (7502299 -> 75110df)

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

orpiske pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git.


    from 7502299  Remove Github changelog action
     new f9a3e56  Fixed incorrect number of arguments in HDFS test logs
     new 18f5869  Removed invalid throws in RabbitMQ test client code
     new 6d2493c  Fixed invalid usage of raw types
     new df27d6f  Removed declarations of exceptions never thrown
     new d65aa45  Removed unnecessary string scaping in test logs
     new e886eab  Simplified assertion in the elastic search sink test
     new bfa8e7c  Do fail the AWS S3 test on I/O error while reading the files
     new e52aba2  Force the embedded runner to throw an exception if the provided service is null
     new 99214cf  Add an warning if the embedded runner times out before fully stopped
     new b9d85de  Use a final variable for test connector properties
     new ffedadd  Cleanup iteration over test result set
     new 03f9486  Use the StandardsCharset to avoid the UnsupportedEncodingException
     new bddecd6  Use the join method to simplify building the plugin paths
     new 75110df  Use a immutable singleton list instead in the test KafkaClient

The 14 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../aws/v2/s3/source/CamelSourceAWSS3ITCase.java     | 11 ++++++++++-
 .../blob/sink/CamelSinkAzureStorageBlobITCase.java   |  4 ++--
 .../queue/sink/CamelSinkAzureStorageQueueITCase.java |  2 +-
 .../common/BasicConnectorPropertyFactory.java        |  2 +-
 .../kafkaconnector/common/PluginPathHelper.java      |  2 +-
 .../common/clients/kafka/KafkaClient.java            |  5 ++---
 .../common/services/kafka/EmbeddedKafkaService.java  |  4 ++--
 .../services/kafkaconnect/KafkaConnectRunner.java    |  2 +-
 .../kafkaconnect/KafkaConnectRunnerService.java      |  6 ++++--
 .../services/kafkaconnect/KafkaConnectService.java   |  4 ++--
 .../sink/CamelSinkElasticSearchITCase.java           |  2 +-
 .../hdfs/sink/CamelSinkHDFSITCase.java               |  4 ++--
 .../kafkaconnector/jdbc/client/DatabaseClient.java   |  2 +-
 .../jdbc/sink/CamelSinkJDBCITCase.java               |  2 +-
 .../jdbc/sink/CamelSinkJDBCNoDataSourceITCase.java   |  2 +-
 .../mongodb/sink/CamelSinkMongoDBITCase.java         |  2 +-
 .../rabbitmq/clients/RabbitMQClient.java             |  2 --
 .../rabbitmq/sink/RabbitMQSinkITCase.java            | 20 +++++++-------------
 .../kafkaconnector/sql/client/DatabaseClient.java    |  2 +-
 .../kafkaconnector/sql/sink/CamelSinkSQLITCase.java  |  2 +-
 .../sql/source/CamelSourceSQLITCase.java             |  2 +-
 .../kafkaconnector/ssh/services/SshService.java      |  4 ++--
 .../syslog/services/SyslogService.java               |  4 ++--
 .../syslog/source/CamelSourceSyslogITCase.java       |  4 ++--
 24 files changed, 49 insertions(+), 47 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 01/14: Fixed incorrect number of arguments in HDFS test logs

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

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit f9a3e56093ea76648c82d05634b09fa66caf7bf5
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 14:37:19 2021 +0100

    Fixed incorrect number of arguments in HDFS test logs
---
 .../apache/camel/kafkaconnector/hdfs/sink/CamelSinkHDFSITCase.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/itests-hdfs/src/test/java/org/apache/camel/kafkaconnector/hdfs/sink/CamelSinkHDFSITCase.java b/tests/itests-hdfs/src/test/java/org/apache/camel/kafkaconnector/hdfs/sink/CamelSinkHDFSITCase.java
index 1a27f5c..00234b5 100644
--- a/tests/itests-hdfs/src/test/java/org/apache/camel/kafkaconnector/hdfs/sink/CamelSinkHDFSITCase.java
+++ b/tests/itests-hdfs/src/test/java/org/apache/camel/kafkaconnector/hdfs/sink/CamelSinkHDFSITCase.java
@@ -70,14 +70,14 @@ public class CamelSinkHDFSITCase extends AbstractKafkaTest {
 
         if (!hdfsEasy.delete(currentBasePath)) {
             // This is OK: directory may not exist on the path
-            LOG.debug("The directory at {} was not removed {}", currentBasePath.getName());
+            LOG.debug("The directory at {} was not removed", currentBasePath.getName());
         }
     }
 
     @AfterEach
     public void tearDown() {
         if (!hdfsEasy.delete(currentBasePath)) {
-            LOG.warn("The directory at {} was not removed {}", currentBasePath.getName());
+            LOG.warn("The directory at {} was not removed", currentBasePath.getName());
         }
     }
 

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 02/14: Removed invalid throws in RabbitMQ test client code

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 18f58690c24426aed0294a8e472a1a069884ad46
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 14:38:29 2021 +0100

    Removed invalid throws in RabbitMQ test client code
---
 .../apache/camel/kafkaconnector/rabbitmq/clients/RabbitMQClient.java    | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/clients/RabbitMQClient.java b/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/clients/RabbitMQClient.java
index 19da657..795ad28 100644
--- a/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/clients/RabbitMQClient.java
+++ b/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/clients/RabbitMQClient.java
@@ -17,7 +17,6 @@
 package org.apache.camel.kafkaconnector.rabbitmq.clients;
 
 import java.io.Closeable;
-import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 
 import com.rabbitmq.client.AMQP;
@@ -159,7 +158,6 @@ public class RabbitMQClient {
      *
      * @param queue the queue to send data to
      * @param data  the (string) data to send
-     * @throws IOException
      */
     public void send(final String queue, final String data) {
         try {

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 03/14: Fixed invalid usage of raw types

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 6d2493c18eaa0b53571a0f2cbe722a89359bdf17
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:05:22 2021 +0100

    Fixed invalid usage of raw types
---
 .../kafkaconnector/common/services/kafkaconnect/KafkaConnectRunner.java | 2 +-
 .../org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCITCase.java  | 2 +-
 .../camel/kafkaconnector/jdbc/sink/CamelSinkJDBCNoDataSourceITCase.java | 2 +-
 .../org/apache/camel/kafkaconnector/sql/sink/CamelSinkSQLITCase.java    | 2 +-
 .../apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunner.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunner.java
index c068fe4..d626c44 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunner.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunner.java
@@ -216,7 +216,7 @@ class KafkaConnectRunner {
     public void stop() {
         if (connect != null) {
             LOG.info("Removing topics used during the test");
-            KafkaClient kafkaClient = new KafkaClient(bootstrapServer);
+            KafkaClient<?, ?> kafkaClient = new KafkaClient<>(bootstrapServer);
 
             for (String connector : herder.connectors()) {
                 herder.connectorActiveTopics(connector).topics().forEach(t -> kafkaClient.deleteTopic(t));
diff --git a/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCITCase.java b/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCITCase.java
index 0d6bb8e..4e74e51 100644
--- a/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCITCase.java
+++ b/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCITCase.java
@@ -63,7 +63,7 @@ public class CamelSinkJDBCITCase extends AbstractKafkaTest {
     static {
         final String postgresImage = "postgres:9.6.2";
 
-        JdbcDatabaseContainer container = new PostgreSQLContainer(postgresImage)
+        JdbcDatabaseContainer<?> container = new PostgreSQLContainer<>(postgresImage)
                 .withDatabaseName("camel")
                 .withUsername("ckc")
                 .withPassword("ckcDevel123")
diff --git a/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCNoDataSourceITCase.java b/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCNoDataSourceITCase.java
index 73876d3..f678239 100644
--- a/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCNoDataSourceITCase.java
+++ b/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/sink/CamelSinkJDBCNoDataSourceITCase.java
@@ -62,7 +62,7 @@ public class CamelSinkJDBCNoDataSourceITCase extends AbstractKafkaTest {
     static {
         final String postgresImage = "postgres:9.6.2";
 
-        JdbcDatabaseContainer container = new PostgreSQLContainer(postgresImage)
+        JdbcDatabaseContainer<?> container = new PostgreSQLContainer<>(postgresImage)
                 .withDatabaseName("camel")
                 .withUsername("ckc")
                 .withPassword("ckcDevel123")
diff --git a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/sink/CamelSinkSQLITCase.java b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/sink/CamelSinkSQLITCase.java
index 1d75fa2..ece0c24 100644
--- a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/sink/CamelSinkSQLITCase.java
+++ b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/sink/CamelSinkSQLITCase.java
@@ -59,7 +59,7 @@ public class CamelSinkSQLITCase extends AbstractKafkaTest {
     private int received;
 
     public CamelSinkSQLITCase() {
-        JdbcDatabaseContainer container = new PostgreSQLContainer("postgres:9.6.2")
+        JdbcDatabaseContainer<?> container = new PostgreSQLContainer<>("postgres:9.6.2")
                 .withDatabaseName("camel")
                 .withUsername("ckc")
                 .withPassword("ckcDevel123")
diff --git a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java
index aab7045..05d6ae4 100644
--- a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java
+++ b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java
@@ -52,7 +52,7 @@ public class CamelSourceSQLITCase extends AbstractKafkaTest {
     private int received;
 
     public CamelSourceSQLITCase() {
-        JdbcDatabaseContainer container = new PostgreSQLContainer("postgres:9.6.2")
+        JdbcDatabaseContainer<?> container = new PostgreSQLContainer<>("postgres:9.6.2")
                 .withDatabaseName("camel")
                 .withUsername("ckc")
                 .withPassword("ckcDevel123")

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 04/14: Removed declarations of exceptions never thrown

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit df27d6f1961a345c0ea99c2976275e885f96d6dc
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:07:47 2021 +0100

    Removed declarations of exceptions never thrown
---
 .../azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java      | 2 +-
 .../azure/storage/queue/sink/CamelSinkAzureStorageQueueITCase.java    | 2 +-
 .../kafkaconnector/common/services/kafka/EmbeddedKafkaService.java    | 4 ++--
 .../common/services/kafkaconnect/KafkaConnectService.java             | 4 ++--
 .../camel/kafkaconnector/mongodb/sink/CamelSinkMongoDBITCase.java     | 2 +-
 .../java/org/apache/camel/kafkaconnector/ssh/services/SshService.java | 4 ++--
 .../apache/camel/kafkaconnector/syslog/services/SyslogService.java    | 4 ++--
 .../camel/kafkaconnector/syslog/source/CamelSourceSyslogITCase.java   | 4 ++--
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java b/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java
index e7e5b81..938ac03 100644
--- a/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java
+++ b/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java
@@ -134,7 +134,7 @@ public class CamelSinkAzureStorageBlobITCase extends AbstractKafkaTest {
         }
     }
 
-    public void runTest(ConnectorPropertyFactory connectorPropertyFactory) throws ExecutionException, InterruptedException, IOException {
+    public void runTest(ConnectorPropertyFactory connectorPropertyFactory) throws ExecutionException, InterruptedException {
         connectorPropertyFactory.log();
         getKafkaConnectService().initializeConnectorBlocking(connectorPropertyFactory, 1);
 
diff --git a/tests/itests-azure-storage-queue/src/test/java/org/apache/camel/kafkaconnector/azure/storage/queue/sink/CamelSinkAzureStorageQueueITCase.java b/tests/itests-azure-storage-queue/src/test/java/org/apache/camel/kafkaconnector/azure/storage/queue/sink/CamelSinkAzureStorageQueueITCase.java
index 2a49dcc..b0636ff 100644
--- a/tests/itests-azure-storage-queue/src/test/java/org/apache/camel/kafkaconnector/azure/storage/queue/sink/CamelSinkAzureStorageQueueITCase.java
+++ b/tests/itests-azure-storage-queue/src/test/java/org/apache/camel/kafkaconnector/azure/storage/queue/sink/CamelSinkAzureStorageQueueITCase.java
@@ -118,7 +118,7 @@ public class CamelSinkAzureStorageQueueITCase extends AbstractKafkaTest {
     }
 
 
-    public void runTest(ConnectorPropertyFactory connectorPropertyFactory) throws ExecutionException, InterruptedException, IOException {
+    public void runTest(ConnectorPropertyFactory connectorPropertyFactory) throws ExecutionException, InterruptedException {
         connectorPropertyFactory.log();
         getKafkaConnectService().initializeConnectorBlocking(connectorPropertyFactory, 1);
 
diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java
index 4c43ae0..3ce25d3 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java
@@ -105,12 +105,12 @@ public class EmbeddedKafkaService implements KafkaService {
     }
 
     @Override
-    public void beforeTestExecution(ExtensionContext extensionContext) throws Exception {
+    public void beforeTestExecution(ExtensionContext extensionContext) {
         initialize();
     }
 
     @Override
-    public void afterTestExecution(ExtensionContext context) throws Exception {
+    public void afterTestExecution(ExtensionContext context) {
         shutdown();
     }
 
diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectService.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectService.java
index 39a11c9..5ae9e07 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectService.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectService.java
@@ -33,12 +33,12 @@ public interface KafkaConnectService extends BeforeTestExecutionCallback, AfterT
     void start();
 
     @Override
-    default void afterTestExecution(ExtensionContext extensionContext) throws Exception {
+    default void afterTestExecution(ExtensionContext extensionContext) {
         stop();
     }
 
     @Override
-    default void beforeTestExecution(ExtensionContext extensionContext) throws Exception {
+    default void beforeTestExecution(ExtensionContext extensionContext) {
         start();
     }
 }
diff --git a/tests/itests-mongodb/src/test/java/org/apache/camel/kafkaconnector/mongodb/sink/CamelSinkMongoDBITCase.java b/tests/itests-mongodb/src/test/java/org/apache/camel/kafkaconnector/mongodb/sink/CamelSinkMongoDBITCase.java
index 19862b5..eb4cf2f 100644
--- a/tests/itests-mongodb/src/test/java/org/apache/camel/kafkaconnector/mongodb/sink/CamelSinkMongoDBITCase.java
+++ b/tests/itests-mongodb/src/test/java/org/apache/camel/kafkaconnector/mongodb/sink/CamelSinkMongoDBITCase.java
@@ -87,7 +87,7 @@ public class CamelSinkMongoDBITCase extends AbstractKafkaTest {
         return collection.countDocuments() >= expect;
     }
 
-    private void verifyDocuments(String database, String collectionName) throws InterruptedException {
+    private void verifyDocuments(String database, String collectionName) {
         MongoDatabase mongoDatabase = mongoClient.getDatabase(database);
         MongoCollection<Document> collection = mongoDatabase.getCollection(collectionName);
 
diff --git a/tests/itests-ssh/src/test/java/org/apache/camel/kafkaconnector/ssh/services/SshService.java b/tests/itests-ssh/src/test/java/org/apache/camel/kafkaconnector/ssh/services/SshService.java
index d5a375e..c2dcef7 100644
--- a/tests/itests-ssh/src/test/java/org/apache/camel/kafkaconnector/ssh/services/SshService.java
+++ b/tests/itests-ssh/src/test/java/org/apache/camel/kafkaconnector/ssh/services/SshService.java
@@ -42,12 +42,12 @@ public interface SshService extends BeforeAllCallback, AfterAllCallback {
     void shutdown();
 
     @Override
-    default void beforeAll(ExtensionContext extensionContext) throws Exception {
+    default void beforeAll(ExtensionContext extensionContext) {
         initialize();
     }
 
     @Override
-    default void afterAll(ExtensionContext extensionContext) throws Exception {
+    default void afterAll(ExtensionContext extensionContext) {
         shutdown();
     }
 }
diff --git a/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/services/SyslogService.java b/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/services/SyslogService.java
index 3b3a508..3bc07b3 100644
--- a/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/services/SyslogService.java
+++ b/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/services/SyslogService.java
@@ -44,7 +44,7 @@ public class SyslogService implements BeforeAllCallback, AfterAllCallback {
         CAMEL_CONTEXT.getRegistry().bind("decoder", new Rfc5425FrameDecoder());
         CAMEL_CONTEXT.addRoutes(new RouteBuilder() {
             @Override
-            public void configure() throws Exception {
+            public void configure() {
                 from("netty:" + protocol + ":" + host + ":" + port + "?sync=false&decoders=#decoder").unmarshal(new SyslogDataFormat()).to("seda:syslog");
             }
         });
@@ -52,7 +52,7 @@ public class SyslogService implements BeforeAllCallback, AfterAllCallback {
     }
 
     @Override
-    public void afterAll(ExtensionContext context) throws Exception {
+    public void afterAll(ExtensionContext context) {
         CAMEL_CONTEXT.stop();
     }
 
diff --git a/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/source/CamelSourceSyslogITCase.java b/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/source/CamelSourceSyslogITCase.java
index 548d9cf..8dc49bc 100644
--- a/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/source/CamelSourceSyslogITCase.java
+++ b/tests/itests-syslog/src/test/java/org/apache/camel/kafkaconnector/syslog/source/CamelSourceSyslogITCase.java
@@ -64,14 +64,14 @@ public class CamelSourceSyslogITCase extends AbstractKafkaTest {
         received = 0;
     }
 
-    private void produceLogMessages(String protocol, String host, String port, String message) throws Exception {
+    private void produceLogMessages(String protocol, String host, String port, String message) {
         CamelContext camelContext = new DefaultCamelContext();
 
         try {
             camelContext.getRegistry().bind("encoder", new Rfc5425Encoder());
             camelContext.addRoutes(new RouteBuilder() {
                 @Override
-                public void configure() throws Exception {
+                public void configure() {
                     from("direct:test").marshal(new SyslogDataFormat()).to("netty:" + protocol + ":" + host + ":" + port + "?sync=false&encoders=#encoder&useByteBuf=true");
                 }
             });

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 05/14: Removed unnecessary string scaping in test logs

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit d65aa45925fed9e55c139c402d680ea1a64e67ec
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:08:55 2021 +0100

    Removed unnecessary string scaping in test logs
---
 .../azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java b/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java
index 938ac03..2b46470 100644
--- a/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java
+++ b/tests/itests-azure-storage-blob/src/test/java/org/apache/camel/kafkaconnector/azure/storage/blob/sink/CamelSinkAzureStorageBlobITCase.java
@@ -102,7 +102,7 @@ public class CamelSinkAzureStorageBlobITCase extends AbstractKafkaTest {
                 blobClient.download(outputStream);
                 String contentFile = outputStream.toString();
 
-                LOG.info("Received: \'{}\' with content: \'{}\'", receivedFile, contentFile);
+                LOG.info("Received: '{}' with content: '{}'", receivedFile, contentFile);
                 assertEquals(sentData.get(receivedFile), contentFile, "Did not receive the same message that was sent");
 
                 received++;

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 06/14: Simplified assertion in the elastic search sink test

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit e886eabbc322f5c1093b759611bc06576756b94d
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:09:41 2021 +0100

    Simplified assertion in the elastic search sink test
---
 .../kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java b/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java
index c30f735..8358aac 100644
--- a/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java
+++ b/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java
@@ -97,7 +97,7 @@ public class CamelSinkElasticSearchITCase extends AbstractKafkaTest {
     private void verifyHit(SearchHit searchHit) {
         String source = searchHit.getSourceAsString();
 
-        assertTrue(source != null);
+        assertNotNull(source);
         assertFalse(source.isEmpty());
 
         // TODO: this is not enough, we need to parse the json and check the key itself

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 07/14: Do fail the AWS S3 test on I/O error while reading the files

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit bfa8e7cdea2466bcefde9ea20df823122ff57542
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:14:35 2021 +0100

    Do fail the AWS S3 test on I/O error while reading the files
---
 .../aws/v2/s3/source/CamelSourceAWSS3ITCase.java              | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/s3/source/CamelSourceAWSS3ITCase.java b/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/s3/source/CamelSourceAWSS3ITCase.java
index 4169816..bae5c77 100644
--- a/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/s3/source/CamelSourceAWSS3ITCase.java
+++ b/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/s3/source/CamelSourceAWSS3ITCase.java
@@ -176,6 +176,10 @@ public class CamelSourceAWSS3ITCase extends AbstractKafkaTest {
         LOG.debug("Putting S3 objects");
 
         File[] files = path.listFiles();
+        if (files == null) {
+            fail("Either I/O error or the path used is not a directory");
+        }
+
         expect = files.length;
 
         if (files.length == 0) {
@@ -297,7 +301,12 @@ public class CamelSourceAWSS3ITCase extends AbstractKafkaTest {
 
         runTest(connectorPropertyFactory, () -> sendFilesFromPath(path));
 
-        assertEquals(path.list().length, received, "Didn't process the expected amount of messages");
+        String[] files = path.list();
+        if (files == null) {
+            fail("Either I/O error or the path used is not a directory");
+        }
+
+        assertEquals(files.length, received, "Didn't process the expected amount of messages");
     }
 
 }

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 08/14: Force the embedded runner to throw an exception if the provided service is null

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit e52aba2c556d418e46d9af078a7dd5fe6c1183d3
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:16:38 2021 +0100

    Force the embedded runner to throw an exception if the provided service is null
---
 .../common/services/kafkaconnect/KafkaConnectRunnerService.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java
index 8fadc26..c895490 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java
@@ -41,7 +41,7 @@ public class KafkaConnectRunnerService implements KafkaConnectService {
 
 
     public KafkaConnectRunnerService(KafkaService kafkaService) {
-        Objects.nonNull(kafkaService);
+        Objects.requireNonNull(kafkaService);
 
         LOG.debug("Connecting the Kafka Connect Runner to {}", kafkaService.getBootstrapServers());
         this.kafkaConnectRunner = new KafkaConnectRunner(kafkaService.getBootstrapServers());

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 13/14: Use the join method to simplify building the plugin paths

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit bddecd63394dadb4773777040e30ea49dd33b849
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:28:06 2021 +0100

    Use the join method to simplify building the plugin paths
---
 .../java/org/apache/camel/kafkaconnector/common/PluginPathHelper.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/PluginPathHelper.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/PluginPathHelper.java
index fdda6db..e19d8c3 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/PluginPathHelper.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/PluginPathHelper.java
@@ -135,7 +135,7 @@ public final class PluginPathHelper {
      * ref: https://docs.confluent.io/current/connect/userguide.html
      */
     public String pluginPaths() {
-        String ret = findPluginPaths().stream().collect(Collectors.joining(","));
+        String ret = String.join(",", findPluginPaths());
         LOG.info("Returning the following directories for the plugin path: {}", ret);
 
         return ret;

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 09/14: Add an warning if the embedded runner times out before fully stopped

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 99214cfb4c991be516191df93080a10269f6ae99
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:18:07 2021 +0100

    Add an warning if the embedded runner times out before fully stopped
---
 .../common/services/kafkaconnect/KafkaConnectRunnerService.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java
index c895490..4c623a6 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/KafkaConnectRunnerService.java
@@ -96,7 +96,9 @@ public class KafkaConnectRunnerService implements KafkaConnectService {
     public void stop() {
         kafkaConnectRunner.stop();
         try {
-            service.awaitTermination(5, TimeUnit.SECONDS);
+            if (!service.awaitTermination(5, TimeUnit.SECONDS)) {
+                LOG.warn("Timed out while waiting for the embedded runner to stop");
+            }
         } catch (InterruptedException e) {
             LOG.warn("The test was interrupted while executing");
         }

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 10/14: Use a final variable for test connector properties

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit b9d85ded0816b6fd7233a317f81b90ca71158bf1
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:23:04 2021 +0100

    Use a final variable for test connector properties
---
 .../camel/kafkaconnector/common/BasicConnectorPropertyFactory.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/BasicConnectorPropertyFactory.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/BasicConnectorPropertyFactory.java
index 5bc2659..1dc3bdd 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/BasicConnectorPropertyFactory.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/BasicConnectorPropertyFactory.java
@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
 import org.apache.kafka.connect.runtime.ConnectorConfig;
 
 public abstract class BasicConnectorPropertyFactory<T extends BasicConnectorPropertyFactory<T>> implements ConnectorPropertyFactory {
-    private Properties connectorProps = new Properties();
+    private final Properties connectorProps = new Properties();
 
     public T withName(String name) {
         connectorProps.put(ConnectorConfig.NAME_CONFIG, name);

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 11/14: Cleanup iteration over test result set

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit ffedadd2dc977c29ba2eaa281d16785784ea8d16
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:23:45 2021 +0100

    Cleanup iteration over test result set
---
 .../org/apache/camel/kafkaconnector/jdbc/client/DatabaseClient.java     | 2 +-
 .../java/org/apache/camel/kafkaconnector/sql/client/DatabaseClient.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/client/DatabaseClient.java b/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/client/DatabaseClient.java
index 855fcdc..72b9bfb 100644
--- a/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/client/DatabaseClient.java
+++ b/tests/itests-jdbc/src/test/java/org/apache/camel/kafkaconnector/jdbc/client/DatabaseClient.java
@@ -54,7 +54,7 @@ public class DatabaseClient {
         String query = String.format("select count(*) as count from %s", table);
 
         try (ResultSet rs = connection.prepareStatement(query).executeQuery()) {
-            while (rs.next()) {
+            if (rs.next()) {
                 return rs.getInt("count");
             }
         }
diff --git a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/client/DatabaseClient.java b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/client/DatabaseClient.java
index f3e8c21..5dbd27f 100644
--- a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/client/DatabaseClient.java
+++ b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/client/DatabaseClient.java
@@ -54,7 +54,7 @@ public class DatabaseClient {
         String query = String.format("select count(*) as count from %s", table);
 
         try (ResultSet rs = connection.prepareStatement(query).executeQuery()) {
-            while (rs.next()) {
+            if (rs.next()) {
                 return rs.getInt("count");
             }
         }

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 14/14: Use a immutable singleton list instead in the test KafkaClient

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 75110dfe4981445fe488ab4bf25fb05be568e040
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:33:25 2021 +0100

    Use a immutable singleton list instead in the test KafkaClient
---
 .../camel/kafkaconnector/common/clients/kafka/KafkaClient.java       | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/clients/kafka/KafkaClient.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/clients/kafka/KafkaClient.java
index a124a5d..4830843 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/clients/kafka/KafkaClient.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/clients/kafka/KafkaClient.java
@@ -18,7 +18,6 @@
 package org.apache.camel.kafkaconnector.common.clients.kafka;
 
 import java.time.Duration;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Properties;
@@ -90,7 +89,7 @@ public class KafkaClient<K, V> {
      * @param recordConsumer the a function to consume the received messages
      */
     public void consumeAvailable(String topic, Consumer<ConsumerRecord<K, V>> recordConsumer) {
-        consumer.subscribe(Arrays.asList(topic));
+        consumer.subscribe(Collections.singletonList(topic));
 
         ConsumerRecords<K, V> records = consumer.poll(Duration.ofMillis(100));
         for (ConsumerRecord<K, V> record : records) {
@@ -106,7 +105,7 @@ public class KafkaClient<K, V> {
      * @param predicate the predicate to test when the messages arrive
      */
     public void consume(String topic, Predicate<ConsumerRecord<K, V>> predicate) {
-        consumer.subscribe(Arrays.asList(topic));
+        consumer.subscribe(Collections.singletonList(topic));
 
         // TODO: handle failures, timeouts, etc
         while (true) {

Reply | Threaded
Open this post in threaded view
|

[camel-kafka-connector] 12/14: Use the StandardsCharset to avoid the UnsupportedEncodingException

orpiske
In reply to this post by orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 03f9486c52912b9037bc04d81d2eef98cd47218d
Author: Otavio Rodolfo Piske <[hidden email]>
AuthorDate: Wed Jan 13 15:26:01 2021 +0100

    Use the StandardsCharset to avoid the UnsupportedEncodingException
---
 .../rabbitmq/sink/RabbitMQSinkITCase.java            | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/sink/RabbitMQSinkITCase.java b/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/sink/RabbitMQSinkITCase.java
index 8635469..d2c3ad6 100644
--- a/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/sink/RabbitMQSinkITCase.java
+++ b/tests/itests-rabbitmq/src/test/java/org/apache/camel/kafkaconnector/rabbitmq/sink/RabbitMQSinkITCase.java
@@ -16,7 +16,7 @@
  */
 package org.apache.camel.kafkaconnector.rabbitmq.sink;
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.concurrent.CountDownLatch;
 
 import com.rabbitmq.client.DeliverCallback;
@@ -63,22 +63,16 @@ public class RabbitMQSinkITCase extends AbstractKafkaTest {
     }
 
     private boolean checkRecord(Delivery rabbitMQDelivery) {
-        try {
-            String message = new String(rabbitMQDelivery.getBody(), "UTF-8");
-            LOG.debug("Received: {}", message);
-
-            received++;
+        String message = new String(rabbitMQDelivery.getBody(), StandardCharsets.UTF_8);
+        LOG.debug("Received: {}", message);
 
-            if (received == expect) {
-                return false;
-            }
+        received++;
 
-            return true;
-        } catch (UnsupportedEncodingException e) {
-            LOG.error("Failed to read message: {}", e.getMessage(), e);
-            fail("Failed to read message: " + e.getMessage());
+        if (received == expect) {
             return false;
         }
+
+        return true;
     }
 
     private void runBasicStringTest(ConnectorPropertyFactory connectorPropertyFactory) throws Exception {