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/12/21 11:53:12 UTC

[camel] branch master updated (c5ca774 -> 2a4f416)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from c5ca774  Camel-Rabbitmq: Fixed CS
     new 348e803  CAMEL-14314 - Camel-AWS Translate: Being able of set source and target language as endpoint options
     new a2854a2  CAMEL-14314 - Added tests
     new 17e3038  CAMEL-14314 - Fixed CS
     new 2a4f416  Regen

The 4 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:
 .../src/main/docs/aws-translate-component.adoc     |  4 ++-
 .../aws/translate/TranslateConfiguration.java      | 26 ++++++++++++++++++
 .../component/aws/translate/TranslateProducer.java | 32 ++++++++++++++--------
 .../aws/translate/TranslateProducerTest.java       | 20 ++++++++++++++
 .../dsl/TranslateEndpointBuilderFactory.java       | 22 +++++++++++++++
 docs/components/modules/ROOT/nav.adoc              |  2 ++
 .../modules/ROOT/pages/any23-dataformat.adoc       |  2 +-
 .../ROOT/pages/aws-translate-component.adoc        |  2 +-
 docs/components/modules/ROOT/pages/index.adoc      | 14 +++++-----
 9 files changed, 103 insertions(+), 21 deletions(-)


[camel] 03/04: CAMEL-14314 - Fixed CS

Posted by ac...@apache.org.
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 17e30384fc83f906b0b942f79644b7151d8f6fc7
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Dec 21 12:17:44 2019 +0100

    CAMEL-14314 - Fixed CS
---
 .../aws/translate/TranslateConfiguration.java      | 30 +++++++++----------
 .../component/aws/translate/TranslateProducer.java | 34 +++++++++++-----------
 .../aws/translate/TranslateProducerTest.java       |  5 ++--
 3 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java
index d36a97e..7bf1356 100644
--- a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java
+++ b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java
@@ -155,34 +155,34 @@ public class TranslateConfiguration implements Cloneable {
     public void setAutodetectSourceLanguage(boolean autodetectSourceLanguage) {
         this.autodetectSourceLanguage = autodetectSourceLanguage;
     }
-    
+
     public String getSourceLanguage() {
-		return sourceLanguage;
-	}
+        return sourceLanguage;
+    }
 
     /**
      * Source language to use
      */
-	public void setSourceLanguage(String sourceLanguage) {
-		this.sourceLanguage = sourceLanguage;
-	}
-
-	public String getTargetLanguage() {
-		return targetLanguage;
-	}
-	
+    public void setSourceLanguage(String sourceLanguage) {
+        this.sourceLanguage = sourceLanguage;
+    }
+
+    public String getTargetLanguage() {
+        return targetLanguage;
+    }
+
     /**
      * Target language to use
      */
-	public void setTargetLanguage(String targetLanguage) {
-		this.targetLanguage = targetLanguage;
-	}
+    public void setTargetLanguage(String targetLanguage) {
+        this.targetLanguage = targetLanguage;
+    }
 
     // *************************************************
     //
     // *************************************************
 
-	public TranslateConfiguration copy() {
+    public TranslateConfiguration copy() {
         try {
             return (TranslateConfiguration)super.clone();
         } catch (CloneNotSupportedException e) {
diff --git a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java
index 44b1a75..6b2cc56 100644
--- a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java
+++ b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java
@@ -80,29 +80,29 @@ public class TranslateProducer extends DefaultProducer {
     private void translateText(AmazonTranslate translateClient, Exchange exchange) {
         TranslateTextRequest request = new TranslateTextRequest();
         if (!getConfiguration().isAutodetectSourceLanguage()) {
-        	if (ObjectHelper.isEmpty(getConfiguration().getSourceLanguage()) && ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
-            String source = exchange.getIn().getHeader(TranslateConstants.SOURCE_LANGUAGE, String.class);
-            String target = exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
-            if (ObjectHelper.isEmpty(source) || ObjectHelper.isEmpty(target)) {
-                throw new IllegalArgumentException("Source and target language must be specified as headers or endpoint options");
-            }
-            request.setSourceLanguageCode(source);
-            request.setTargetLanguageCode(target);
-        	} else {
+            if (ObjectHelper.isEmpty(getConfiguration().getSourceLanguage()) && ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
+                String source = exchange.getIn().getHeader(TranslateConstants.SOURCE_LANGUAGE, String.class);
+                String target = exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
+                if (ObjectHelper.isEmpty(source) || ObjectHelper.isEmpty(target)) {
+                    throw new IllegalArgumentException("Source and target language must be specified as headers or endpoint options");
+                }
+                request.setSourceLanguageCode(source);
+                request.setTargetLanguageCode(target);
+            } else {
                 request.setSourceLanguageCode(getConfiguration().getSourceLanguage());
                 request.setTargetLanguageCode(getConfiguration().getTargetLanguage());
-        	}
+            }
         } else {
             String source = "auto";
             if (ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
-            String target = exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
-            if (ObjectHelper.isEmpty(source) || ObjectHelper.isEmpty(target)) {
-                throw new IllegalArgumentException("Target language must be specified when autodetection of source language is enabled");
-            }
-            request.setSourceLanguageCode(source);
-            request.setTargetLanguageCode(target);
+                String target = exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
+                if (ObjectHelper.isEmpty(source) || ObjectHelper.isEmpty(target)) {
+                    throw new IllegalArgumentException("Target language must be specified when autodetection of source language is enabled");
+                }
+                request.setSourceLanguageCode(source);
+                request.setTargetLanguageCode(target);
             } else {
-            	request.setSourceLanguageCode(source);
+                request.setSourceLanguageCode(source);
                 request.setTargetLanguageCode(getConfiguration().getTargetLanguage());
             }
         }
diff --git a/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java b/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java
index cf41efc..5a2ba1d 100644
--- a/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java
+++ b/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java
@@ -52,7 +52,7 @@ public class TranslateProducerTest extends CamelTestSupport {
         assertEquals("Hello", resultGet);
 
     }
-    
+
     @Test
     public void translateTextTestOptions() throws Exception {
 
@@ -77,7 +77,8 @@ public class TranslateProducerTest extends CamelTestSupport {
             @Override
             public void configure() throws Exception {
                 from("direct:translateText").to("aws-translate://test?translateClient=#amazonTranslateClient&operation=translateText").to("mock:result");
-                from("direct:translateTextOptions").to("aws-translate://test?translateClient=#amazonTranslateClient&operation=translateText&sourceLanguage=it&targetLanguage=en").to("mock:result");
+                from("direct:translateTextOptions").to("aws-translate://test?translateClient=#amazonTranslateClient&operation=translateText&sourceLanguage=it&targetLanguage=en")
+                    .to("mock:result");
             }
         };
     }


[camel] 01/04: CAMEL-14314 - Camel-AWS Translate: Being able of set source and target language as endpoint options

Posted by ac...@apache.org.
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 348e803f9df658808d91ab91f696eaeff2ca7bfc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Dec 21 12:06:22 2019 +0100

    CAMEL-14314 - Camel-AWS Translate: Being able of set source and target language as endpoint options
---
 .../src/main/docs/aws-translate-component.adoc     |  4 +++-
 .../aws/translate/TranslateConfiguration.java      | 28 +++++++++++++++++++++-
 .../component/aws/translate/TranslateProducer.java | 12 +++++++++-
 .../dsl/TranslateEndpointBuilderFactory.java       | 22 +++++++++++++++++
 4 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/components/camel-aws-translate/src/main/docs/aws-translate-component.adoc b/components/camel-aws-translate/src/main/docs/aws-translate-component.adoc
index c5c45d8..f88ba1c 100644
--- a/components/camel-aws-translate/src/main/docs/aws-translate-component.adoc
+++ b/components/camel-aws-translate/src/main/docs/aws-translate-component.adoc
@@ -69,7 +69,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (12 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -84,6 +84,8 @@ with the following path and query parameters:
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the Translate client | HTTPS | Protocol
 | *region* (producer) | The region in which Translate client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() |  | String
 | *secretKey* (producer) | Amazon AWS Secret Key |  | String
+| *sourceLanguage* (producer) | Source language to use |  | String
+| *targetLanguage* (producer) | Target language to use |  | String
 | *translateClient* (producer) | To use a existing configured AWS Translate as client |  | AmazonTranslate
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
diff --git a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java
index 2456745..d36a97e 100644
--- a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java
+++ b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateConfiguration.java
@@ -44,6 +44,10 @@ public class TranslateConfiguration implements Cloneable {
     @UriParam(label = "producer")
     private String proxyHost;
     @UriParam(label = "producer")
+    private String sourceLanguage;
+    @UriParam(label = "producer")
+    private String targetLanguage;
+    @UriParam(label = "producer")
     private Integer proxyPort;
     @UriParam
     private String region;
@@ -151,12 +155,34 @@ public class TranslateConfiguration implements Cloneable {
     public void setAutodetectSourceLanguage(boolean autodetectSourceLanguage) {
         this.autodetectSourceLanguage = autodetectSourceLanguage;
     }
+    
+    public String getSourceLanguage() {
+		return sourceLanguage;
+	}
+
+    /**
+     * Source language to use
+     */
+	public void setSourceLanguage(String sourceLanguage) {
+		this.sourceLanguage = sourceLanguage;
+	}
+
+	public String getTargetLanguage() {
+		return targetLanguage;
+	}
+	
+    /**
+     * Target language to use
+     */
+	public void setTargetLanguage(String targetLanguage) {
+		this.targetLanguage = targetLanguage;
+	}
 
     // *************************************************
     //
     // *************************************************
 
-    public TranslateConfiguration copy() {
+	public TranslateConfiguration copy() {
         try {
             return (TranslateConfiguration)super.clone();
         } catch (CloneNotSupportedException e) {
diff --git a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java
index 2896bf9..44b1a75 100644
--- a/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java
+++ b/components/camel-aws-translate/src/main/java/org/apache/camel/component/aws/translate/TranslateProducer.java
@@ -80,21 +80,31 @@ public class TranslateProducer extends DefaultProducer {
     private void translateText(AmazonTranslate translateClient, Exchange exchange) {
         TranslateTextRequest request = new TranslateTextRequest();
         if (!getConfiguration().isAutodetectSourceLanguage()) {
+        	if (ObjectHelper.isEmpty(getConfiguration().getSourceLanguage()) && ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
             String source = exchange.getIn().getHeader(TranslateConstants.SOURCE_LANGUAGE, String.class);
             String target = exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
             if (ObjectHelper.isEmpty(source) || ObjectHelper.isEmpty(target)) {
-                throw new IllegalArgumentException("Source and target language must be specified");
+                throw new IllegalArgumentException("Source and target language must be specified as headers or endpoint options");
             }
             request.setSourceLanguageCode(source);
             request.setTargetLanguageCode(target);
+        	} else {
+                request.setSourceLanguageCode(getConfiguration().getSourceLanguage());
+                request.setTargetLanguageCode(getConfiguration().getTargetLanguage());
+        	}
         } else {
             String source = "auto";
+            if (ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
             String target = exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
             if (ObjectHelper.isEmpty(source) || ObjectHelper.isEmpty(target)) {
                 throw new IllegalArgumentException("Target language must be specified when autodetection of source language is enabled");
             }
             request.setSourceLanguageCode(source);
             request.setTargetLanguageCode(target);
+            } else {
+            	request.setSourceLanguageCode(source);
+                request.setTargetLanguageCode(getConfiguration().getTargetLanguage());
+            }
         }
         if (!ObjectHelper.isEmpty(exchange.getIn().getHeader(TranslateConstants.TERMINOLOGY_NAMES, Collection.class))) {
             Collection<String> terminologies = exchange.getIn().getHeader(TranslateConstants.TERMINOLOGY_NAMES, Collection.class);
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java
index df2f8f1..3ebfa13 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java
@@ -221,6 +221,28 @@ public interface TranslateEndpointBuilderFactory {
             return this;
         }
         /**
+         * Source language to use.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default TranslateEndpointBuilder sourceLanguage(String sourceLanguage) {
+            doSetProperty("sourceLanguage", sourceLanguage);
+            return this;
+        }
+        /**
+         * Target language to use.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default TranslateEndpointBuilder targetLanguage(String targetLanguage) {
+            doSetProperty("targetLanguage", targetLanguage);
+            return this;
+        }
+        /**
          * To use a existing configured AWS Translate as client.
          * 
          * The option is a:


[camel] 04/04: Regen

Posted by ac...@apache.org.
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 2a4f4166c0785828014afe0783149a1e9aa70674
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Dec 21 12:52:47 2019 +0100

    Regen
---
 docs/components/modules/ROOT/nav.adoc                      |  2 ++
 docs/components/modules/ROOT/pages/any23-dataformat.adoc   |  2 +-
 .../modules/ROOT/pages/aws-translate-component.adoc        |  2 +-
 docs/components/modules/ROOT/pages/index.adoc              | 14 +++++++-------
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index 0b5c531..062b16a 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -6,6 +6,7 @@
 * xref:ahc-component.adoc[AHC Component]
 * xref:amqp-component.adoc[AMQP Component]
 * xref:any23-dataformat.adoc[Any23 DataFormat]
+* xref:any23-dataformat.adoc[Any23 DataFormat]
 * xref:apns-component.adoc[APNS Component]
 * xref:as2-component.adoc[AS2 Component]
 * xref:asn1-dataformat.adoc[ASN.1 File DataFormat]
@@ -42,6 +43,7 @@
 * xref:aws-sqs-component.adoc[AWS Simple Queue Service Component]
 * xref:aws-swf-component.adoc[AWS Simple Workflow Component]
 * xref:aws-translate-component.adoc[AWS Translate Component]
+* xref:aws-translate-component.adoc[AWS Translate Component]
 * xref:aws-xray.adoc[AWS XRay Component]
 * xref:azure-blob-component.adoc[Azure Storage Blob Service Component]
 * xref:azure-queue-component.adoc[Azure Storage Queue Service Component]
diff --git a/docs/components/modules/ROOT/pages/any23-dataformat.adoc b/docs/components/modules/ROOT/pages/any23-dataformat.adoc
index b1c0cc5..7edf558 100644
--- a/docs/components/modules/ROOT/pages/any23-dataformat.adoc
+++ b/docs/components/modules/ROOT/pages/any23-dataformat.adoc
@@ -1,6 +1,6 @@
 [[any23-dataformat]]
 = Any23 DataFormat
-:page-source: components/camel-any23/src/main/docs/any23-dataformat.adoc
+:page-source: components/camel-any23/bin/src/main/docs/any23-dataformat.adoc
 Camel Any23 is a DataFormat that uses the Apache Anything To Triples (Any23) library to extract structured data in RDF from a variety of documents on the web.
 *Since Camel 3.0*
 
diff --git a/docs/components/modules/ROOT/pages/aws-translate-component.adoc b/docs/components/modules/ROOT/pages/aws-translate-component.adoc
index 82505c6..98e17c2 100644
--- a/docs/components/modules/ROOT/pages/aws-translate-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws-translate-component.adoc
@@ -1,6 +1,6 @@
 [[aws-translate-component]]
 = AWS Translate Component
-:page-source: components/camel-aws-translate/src/main/docs/aws-translate-component.adoc
+:page-source: components/camel-aws-translate/bin/src/main/docs/aws-translate-component.adoc
 
 *Since Camel 3.0*
 
diff --git a/docs/components/modules/ROOT/pages/index.adoc b/docs/components/modules/ROOT/pages/index.adoc
index 8bb6b70..57e606f 100644
--- a/docs/components/modules/ROOT/pages/index.adoc
+++ b/docs/components/modules/ROOT/pages/index.adoc
@@ -6,7 +6,7 @@ The following Apache Camel artifacts are provided:
 == Components
 
 // components: START
-Number of Components: 307 in 245 JAR artifacts (0 deprecated)
+Number of Components: 307 in 245 JAR artifacts (1 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |===
@@ -84,7 +84,7 @@ Number of Components: 307 in 245 JAR artifacts (0 deprecated)
 
 | xref:aws-sdb-component.adoc[AWS SimpleDB] (camel-aws-sdb) | 2.9 | The aws-sdb component is for storing and retrieving data from/to Amazon's SDB service.
 
-| xref:aws-translate-component.adoc[AWS Translate] (camel-aws-translate) | 3.0 | The aws-kms is used for managing Amazon Translate
+| xref:aws-translate-component.adoc[AWS Translate] (camel-aws-translate) | 3.0 | The aws-translate component is used for managing Amazon Translate
 
 | xref:azure-blob-component.adoc[Azure Storage Blob Service] (camel-azure) | 2.19 | The azure-blob component is used for storing and retrieving blobs from Azure Storage Blob Service.
 
@@ -108,7 +108,7 @@ Number of Components: 307 in 245 JAR artifacts (0 deprecated)
 
 | xref:caffeine-loadcache-component.adoc[Caffeine LoadCache] (camel-caffeine) | 2.20 | The caffeine-loadcache component is used for integration with Caffeine Load Cache.
 
-| xref:cql-component.adoc[Cassandra CQL] (camel-cassandraql) | 2.15 | The cql component aims at integrating Cassandra 2.0 using the CQL3 API (not the Thrift API).
+| xref:cql-component.adoc[Cassandra CQL] (camel-cassandraql) | 2.15 | The cql component aims at integrating Cassandra 2.0 using the CQL3 API (not the Thrift API). It's based on Cassandra Java Driver provided by DataStax.
 
 | xref:chatscript-component.adoc[ChatScript] (camel-chatscript) | 3.0 | Represents a ChatScript endpoint.
 
@@ -128,7 +128,7 @@ Number of Components: 307 in 245 JAR artifacts (0 deprecated)
 
 | xref:controlbus-component.adoc[Control Bus] (camel-controlbus) | 2.11 | The controlbus component provides easy management of Camel applications based on the Control Bus EIP pattern.
 
-| xref:corda-component.adoc[Corda] (camel-corda) | 2.23 | The corda component uses the corda-rpc to interact with corda nodes.
+| xref:corda-component.adoc[Corda] (camel-corda) | 2.23 | The corda component uses corda-rpc to interact with corda nodes.
 
 | xref:couchbase-component.adoc[Couchbase] (camel-couchbase) | 2.19 | Represents a Couchbase endpoint that can query Views with a Poll strategy and/or produce various type of operations.
 
@@ -136,7 +136,7 @@ Number of Components: 307 in 245 JAR artifacts (0 deprecated)
 
 | xref:crypto-component.adoc[Crypto (JCE)] (camel-crypto) | 2.3 | The crypto component is used for signing and verifying exchanges using the Signature Service of the Java Cryptographic Extension (JCE).
 
-| xref:crypto-cms-component.adoc[Crypto CMS] (camel-crypto-cms) | 2.20 | The crypto cms component is used for encrypting data in CMS Enveloped Data format, decrypting CMS Enveloped Data, signing data in CMS Signed Data format, and verifying CMS Signed Data.
+| xref:crypto-cms-component.adoc[Crypto CMS] (camel-crypto-cms) | 2.20 | *deprecated* The crypto cms component is used for encrypting data in CMS Enveloped Data format, decrypting CMS Enveloped Data, signing data in CMS Signed Data format, and verifying CMS Signed Data.
 
 | xref:cxf-component.adoc[CXF] (camel-cxf) | 1.0 | The cxf component is used for SOAP WebServices using Apache CXF.
 
@@ -262,7 +262,7 @@ Number of Components: 307 in 245 JAR artifacts (0 deprecated)
 
 | xref:hazelcast-seda-component.adoc[Hazelcast SEDA] (camel-hazelcast) | 2.7 | The hazelcast-seda component is used to access Hazelcast BlockingQueue.
 
-| xref:hazelcast-set-component.adoc[Hazelcast Set] (camel-hazelcast) | 2.7 | The camel Endpoint to access Hazelcast distributed set.
+| xref:hazelcast-set-component.adoc[Hazelcast Set] (camel-hazelcast) | 2.7 | The hazelcast-set component is used to access Hazelcast distributed set.
 
 | xref:hazelcast-topic-component.adoc[Hazelcast Topic] (camel-hazelcast) | 2.15 | The hazelcast-topic component is used to access Hazelcast distributed topic.
 
@@ -370,7 +370,7 @@ Number of Components: 307 in 245 JAR artifacts (0 deprecated)
 
 | xref:kubernetes-service-accounts-component.adoc[Kubernetes Service Account] (camel-kubernetes) | 2.17 | The Kubernetes Service Accounts component provides a producer to execute service account operations.
 
-| xref:kubernetes-services-component.adoc[Kubernetes Services] (camel-kubernetes) | 2.17 | The Kubernetes Service Accounts component provides a producer to execute service operations and a consumer to consume service events.
+| xref:kubernetes-services-component.adoc[Kubernetes Services] (camel-kubernetes) | 2.17 | The Kubernetes Services component provides a producer to execute service operations and a consumer to consume service events.
 
 | xref:kudu-component.adoc[Kudu] (camel-kudu) | 3.0 | Represents a Kudu endpoint. A kudu endpoint allows you to interact with Apache Kudu, a free and open source column-oriented data store of the Apache Hadoop ecosystem.
 


[camel] 02/04: CAMEL-14314 - Added tests

Posted by ac...@apache.org.
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 a2854a29234e7ee87227021756c6c7cac7085cab
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Dec 21 12:16:39 2019 +0100

    CAMEL-14314 - Added tests
---
 .../aws/translate/TranslateProducerTest.java          | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java b/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java
index 4f3f507..cf41efc 100644
--- a/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java
+++ b/components/camel-aws-translate/src/test/java/org/apache/camel/component/aws/translate/TranslateProducerTest.java
@@ -52,6 +52,24 @@ public class TranslateProducerTest extends CamelTestSupport {
         assertEquals("Hello", resultGet);
 
     }
+    
+    @Test
+    public void translateTextTestOptions() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translateTextOptions", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody("ciao");
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = exchange.getIn().getBody(String.class);
+        assertEquals("Hello", resultGet);
+
+    }
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
@@ -59,6 +77,7 @@ public class TranslateProducerTest extends CamelTestSupport {
             @Override
             public void configure() throws Exception {
                 from("direct:translateText").to("aws-translate://test?translateClient=#amazonTranslateClient&operation=translateText").to("mock:result");
+                from("direct:translateTextOptions").to("aws-translate://test?translateClient=#amazonTranslateClient&operation=translateText&sourceLanguage=it&targetLanguage=en").to("mock:result");
             }
         };
     }