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 2020/11/16 07:05:43 UTC

[camel] branch master updated (91f5bb0 -> 7aab032)

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 91f5bb0  Regen
     new f99c6a8  CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client
     new 8e29356  CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, regen configurers and component
     new 1c0306b  CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, fixed test
     new fc9a7a3  CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, additional test
     new 62de4eb  CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, regen catalog
     new 7aab032  CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, added a note in the migration guide

The 6 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:
 .../apache/camel/catalog/components/aws2-ecs.json  |  6 ++---
 .../camel/catalog/docs/aws2-ecs-component.adoc     | 10 +++-----
 .../aws2/ecs/ECS2ComponentConfigurer.java          | 11 ++++----
 .../component/aws2/ecs/ECS2EndpointConfigurer.java | 11 ++++----
 .../component/aws2/ecs/ECS2EndpointUriFactory.java |  3 +--
 .../apache/camel/component/aws2/ecs/aws2-ecs.json  |  6 ++---
 .../src/main/docs/aws2-ecs-component.adoc          | 10 +++-----
 .../camel/component/aws2/ecs/ECS2Component.java    | 21 ----------------
 .../component/aws2/ecs/ECS2Configuration.java      | 15 +----------
 .../aws2/ecs/ECS2ComponentClientRegistryTest.java  | 12 ++++-----
 .../dsl/Aws2EcsComponentBuilderFactory.java        | 16 ------------
 .../endpoint/dsl/ECS2EndpointBuilderFactory.java   | 29 ----------------------
 .../modules/ROOT/pages/aws2-ecs-component.adoc     | 10 +++-----
 .../ROOT/pages/camel-3x-upgrade-guide-3_7.adoc     |  5 ++++
 14 files changed, 38 insertions(+), 127 deletions(-)


[camel] 06/06: CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, added a note in the migration guide

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 7aab0324a5ea2b36c5270146c9bfcdc172304dcf
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Nov 16 08:05:03 2020 +0100

    CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, added a note in the migration guide
---
 docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
index 560776a..9a62caa 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
@@ -181,6 +181,11 @@ In this context, it wasn't having any sense to maintain the autodiscoverClient o
 The camel-aws2-ec2 has now support for autowiring the amazonEc2Client option with Ec2Client instance coming from the registry.
 In this context, it wasn't having any sense to maintain the autodiscoverClient option, which has been now removed.
 
+=== Camel-AWS2-ECS Autowire support
+
+The camel-aws2-ecs has now support for autowiring the ecsClient option with EcsClient instance coming from the registry.
+In this context, it wasn't having any sense to maintain the autodiscoverClient option, which has been now removed.
+
 === Camel-AWS2-MQ Autowire support
 
 The camel-aws2-mq has now support for autowiring the amazonMqClient option with MqClient instance coming from the registry.


[camel] 02/06: CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, regen configurers and component

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 8e2935605d4f343a6c95ae4c8282ec935495c798
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Nov 16 07:55:16 2020 +0100

    CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, regen configurers and component
---
 .../camel/catalog/docs/aws2-ecs-component.adoc     | 10 +++-----
 .../aws2/ecs/ECS2ComponentConfigurer.java          | 11 ++++----
 .../component/aws2/ecs/ECS2EndpointConfigurer.java | 11 ++++----
 .../component/aws2/ecs/ECS2EndpointUriFactory.java |  3 +--
 .../apache/camel/component/aws2/ecs/aws2-ecs.json  |  6 ++---
 .../src/main/docs/aws2-ecs-component.adoc          | 10 +++-----
 .../camel/component/aws2/ecs/ECS2Component.java    |  3 ---
 .../dsl/Aws2EcsComponentBuilderFactory.java        | 16 ------------
 .../endpoint/dsl/ECS2EndpointBuilderFactory.java   | 29 ----------------------
 .../modules/ROOT/pages/aws2-ecs-component.adoc     | 10 +++-----
 10 files changed, 25 insertions(+), 84 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ecs-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ecs-component.adoc
index f6f6ba2..dbd52ac 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ecs-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ecs-component.adoc
@@ -42,16 +42,15 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Elastic Container Service (ECS) component supports 14 options, which are listed below.
+The AWS 2 Elastic Container Service (ECS) component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *configuration* (producer) | Component configuration |  | ECS2Configuration
-| *ecsClient* (producer) | To use a existing configured AWS ECS as client |  | EcsClient
+| *ecsClient* (producer) | *Autowired* To use a existing configured AWS ECS as client |  | EcsClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. There are 4 enums and the value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | ECS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
@@ -88,14 +87,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *ecsClient* (producer) | To use a existing configured AWS ECS as client |  | EcsClient
+| *ecsClient* (producer) | *Autowired* To use a existing configured AWS ECS as client |  | EcsClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. There are 4 enums and the value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | ECS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
diff --git a/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurer.java b/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurer.java
index a8dcf5d..9124caf 100644
--- a/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurer.java
+++ b/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurer.java
@@ -30,8 +30,6 @@ public class ECS2ComponentConfigurer extends PropertyConfigurerSupport implement
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "autowiredenabled":
         case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
         case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.ecs.ECS2Configuration.class, value)); return true;
@@ -58,12 +56,15 @@ public class ECS2ComponentConfigurer extends PropertyConfigurerSupport implement
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"ecsClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "autowiredenabled":
         case "autowiredEnabled": return boolean.class;
         case "configuration": return org.apache.camel.component.aws2.ecs.ECS2Configuration.class;
@@ -95,8 +96,6 @@ public class ECS2ComponentConfigurer extends PropertyConfigurerSupport implement
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
         case "autowiredenabled":
         case "autowiredEnabled": return target.isAutowiredEnabled();
         case "configuration": return target.getConfiguration();
diff --git a/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointConfigurer.java b/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointConfigurer.java
index ceddb43..b74c47c 100644
--- a/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointConfigurer.java
+++ b/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointConfigurer.java
@@ -23,8 +23,6 @@ public class ECS2EndpointConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "ecsclient":
         case "ecsClient": target.getConfiguration().setEcsClient(property(camelContext, software.amazon.awssdk.services.ecs.EcsClient.class, value)); return true;
         case "lazystartproducer":
@@ -49,12 +47,15 @@ public class ECS2EndpointConfigurer extends PropertyConfigurerSupport implements
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"ecsClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "ecsclient":
         case "ecsClient": return software.amazon.awssdk.services.ecs.EcsClient.class;
         case "lazystartproducer":
@@ -84,8 +85,6 @@ public class ECS2EndpointConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return target.getConfiguration().getAccessKey();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
         case "ecsclient":
         case "ecsClient": return target.getConfiguration().getEcsClient();
         case "lazystartproducer":
diff --git a/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointUriFactory.java b/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointUriFactory.java
index 1d0490c..9452db4 100644
--- a/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointUriFactory.java
+++ b/components/camel-aws2-ecs/src/generated/java/org/apache/camel/component/aws2/ecs/ECS2EndpointUriFactory.java
@@ -20,8 +20,7 @@ public class ECS2EndpointUriFactory extends org.apache.camel.support.component.E
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(14);
-        props.add("autoDiscoverClient");
+        Set<String> props = new HashSet<>(13);
         props.add("proxyProtocol");
         props.add("secretKey");
         props.add("synchronous");
diff --git a/components/camel-aws2-ecs/src/generated/resources/org/apache/camel/component/aws2/ecs/aws2-ecs.json b/components/camel-aws2-ecs/src/generated/resources/org/apache/camel/component/aws2/ecs/aws2-ecs.json
index a028829..16e9d33 100644
--- a/components/camel-aws2-ecs/src/generated/resources/org/apache/camel/component/aws2/ecs/aws2-ecs.json
+++ b/components/camel-aws2-ecs/src/generated/resources/org/apache/camel/component/aws2/ecs/aws2-ecs.json
@@ -22,9 +22,8 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client inst [...]
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
-    "ecsClient": { "kind": "property", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
+    "ecsClient": { "kind": "property", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.ecs.ECS2Operations", "enum": [ "listClusters", "describeCluster", "createCluster", "deleteCluster" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "descript [...]
     "pojoRequest": { "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
@@ -39,8 +38,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "Logical name" },
-    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client ins [...]
-    "ecsClient": { "kind": "parameter", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
+    "ecsClient": { "kind": "parameter", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.ecs.ECS2Operations", "enum": [ "listClusters", "describeCluster", "createCluster", "deleteCluster" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "descrip [...]
     "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
diff --git a/components/camel-aws2-ecs/src/main/docs/aws2-ecs-component.adoc b/components/camel-aws2-ecs/src/main/docs/aws2-ecs-component.adoc
index f6f6ba2..dbd52ac 100644
--- a/components/camel-aws2-ecs/src/main/docs/aws2-ecs-component.adoc
+++ b/components/camel-aws2-ecs/src/main/docs/aws2-ecs-component.adoc
@@ -42,16 +42,15 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Elastic Container Service (ECS) component supports 14 options, which are listed below.
+The AWS 2 Elastic Container Service (ECS) component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *configuration* (producer) | Component configuration |  | ECS2Configuration
-| *ecsClient* (producer) | To use a existing configured AWS ECS as client |  | EcsClient
+| *ecsClient* (producer) | *Autowired* To use a existing configured AWS ECS as client |  | EcsClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. There are 4 enums and the value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | ECS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
@@ -88,14 +87,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *ecsClient* (producer) | To use a existing configured AWS ECS as client |  | EcsClient
+| *ecsClient* (producer) | *Autowired* To use a existing configured AWS ECS as client |  | EcsClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. There are 4 enums and the value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | ECS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
diff --git a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
index 4d726a1..8d0134c 100644
--- a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
+++ b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
@@ -17,17 +17,14 @@
 package org.apache.camel.component.aws2.ecs;
 
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import software.amazon.awssdk.services.ecs.EcsClient;
 
 /**
  * For working with Amazon ECS SDK v2.
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EcsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EcsComponentBuilderFactory.java
index d7a101b..e09c35b 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EcsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EcsComponentBuilderFactory.java
@@ -47,21 +47,6 @@ public interface Aws2EcsComponentBuilderFactory {
      */
     interface Aws2EcsComponentBuilder extends ComponentBuilder<ECS2Component> {
         /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default Aws2EcsComponentBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * Component configuration.
          * 
          * The option is a:
@@ -262,7 +247,6 @@ public interface Aws2EcsComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
-            case "autoDiscoverClient": getOrCreateConfiguration((ECS2Component) component).setAutoDiscoverClient((boolean) value); return true;
             case "configuration": ((ECS2Component) component).setConfiguration((org.apache.camel.component.aws2.ecs.ECS2Configuration) value); return true;
             case "ecsClient": getOrCreateConfiguration((ECS2Component) component).setEcsClient((software.amazon.awssdk.services.ecs.EcsClient) value); return true;
             case "lazyStartProducer": ((ECS2Component) component).setLazyStartProducer((boolean) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ECS2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ECS2EndpointBuilderFactory.java
index 3a5b644..e140f1c 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ECS2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ECS2EndpointBuilderFactory.java
@@ -39,35 +39,6 @@ public interface ECS2EndpointBuilderFactory {
             return (AdvancedECS2EndpointBuilder) this;
         }
         /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default ECS2EndpointBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default ECS2EndpointBuilder autoDiscoverClient(String autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * To use a existing configured AWS ECS as client.
          * 
          * The option is a:
diff --git a/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc b/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc
index b99c0f25..1bbf334 100644
--- a/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc
@@ -44,16 +44,15 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Elastic Container Service (ECS) component supports 14 options, which are listed below.
+The AWS 2 Elastic Container Service (ECS) component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *configuration* (producer) | Component configuration |  | ECS2Configuration
-| *ecsClient* (producer) | To use a existing configured AWS ECS as client |  | EcsClient
+| *ecsClient* (producer) | *Autowired* To use a existing configured AWS ECS as client |  | EcsClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. There are 4 enums and the value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | ECS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
@@ -90,14 +89,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *ecsClient* (producer) | To use a existing configured AWS ECS as client |  | EcsClient
+| *ecsClient* (producer) | *Autowired* To use a existing configured AWS ECS as client |  | EcsClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. There are 4 enums and the value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | ECS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean


[camel] 05/06: CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, regen catalog

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 62de4eb6a6647d4ac537348f151f43dcd2490986
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Nov 16 08:01:39 2020 +0100

    CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, regen catalog
---
 .../resources/org/apache/camel/catalog/components/aws2-ecs.json     | 6 ++----
 .../camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java   | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ecs.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ecs.json
index a028829..16e9d33 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ecs.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ecs.json
@@ -22,9 +22,8 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client inst [...]
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
-    "ecsClient": { "kind": "property", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
+    "ecsClient": { "kind": "property", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.ecs.ECS2Operations", "enum": [ "listClusters", "describeCluster", "createCluster", "deleteCluster" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "descript [...]
     "pojoRequest": { "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
@@ -39,8 +38,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "Logical name" },
-    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client ins [...]
-    "ecsClient": { "kind": "parameter", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
+    "ecsClient": { "kind": "parameter", "displayName": "Ecs Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ecs.EcsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS ECS as client" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.ecs.ECS2Operations", "enum": [ "listClusters", "describeCluster", "createCluster", "deleteCluster" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "descrip [...]
     "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ecs.ECS2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
index bd552d8..1e54b97 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
@@ -55,7 +55,7 @@ public class ECS2ComponentClientRegistryTest extends CamelTestSupport {
 
         assertSame(clientMock, endpoint.getConfiguration().getEcsClient());
     }
-    
+
     @Test
     public void createEndpointWithAutowireAndNoCreds() throws Exception {
 


[camel] 03/06: CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, fixed test

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 1c0306b20d8d7fda7338275002b8efe6903a71c4
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Nov 16 07:56:55 2020 +0100

    CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, fixed test
---
 .../aws2/ecs/ECS2ComponentClientRegistryTest.java         | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
index ffcd407..b7f92b5 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -47,19 +46,7 @@ public class ECS2ComponentClientRegistryTest extends CamelTestSupport {
     }
 
     @Test
-    public void createEndpointWithAutoDiscoverClientFalse() throws Exception {
-
-        AmazonECSClientMock clientMock = new AmazonECSClientMock();
-        context.getRegistry().bind("amazonEcsClient", clientMock);
-        ECS2Component component = context.getComponent("aws2-ecs", ECS2Component.class);
-        ECS2Endpoint endpoint = (ECS2Endpoint) component
-                .createEndpoint("aws2-ecs://TestDomain?accessKey=xxx&secretKey=yyy&autoDiscoverClient=false");
-
-        assertNotSame(clientMock, endpoint.getConfiguration().getEcsClient());
-    }
-
-    @Test
-    public void createEndpointWithAutoDiscoverClientTrue() throws Exception {
+    public void createEndpointWithAutowire() throws Exception {
 
         AmazonECSClientMock clientMock = new AmazonECSClientMock();
         context.getRegistry().bind("amazonEcsClient", clientMock);


[camel] 01/06: CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client

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 f99c6a8588f838acf1509c6ecc0a4e349505b5be
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Nov 16 07:53:39 2020 +0100

    CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client
---
 .../apache/camel/component/aws2/ecs/ECS2Component.java | 18 ------------------
 .../camel/component/aws2/ecs/ECS2Configuration.java    | 15 +--------------
 2 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
index 377d31d..4d726a1 100644
--- a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
+++ b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
@@ -55,9 +55,6 @@ public class ECS2Component extends DefaultComponent {
         ECS2Configuration configuration = this.configuration != null ? this.configuration.copy() : new ECS2Configuration();
         ECS2Endpoint endpoint = new ECS2Endpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
-        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
-            checkAndSetRegistryClient(configuration, endpoint);
-        }
         if (configuration.getEcsClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("Amazon ecs client or accessKey and secretKey must be specified");
@@ -76,19 +73,4 @@ public class ECS2Component extends DefaultComponent {
     public void setConfiguration(ECS2Configuration configuration) {
         this.configuration = configuration;
     }
-
-    private void checkAndSetRegistryClient(ECS2Configuration configuration, ECS2Endpoint endpoint) {
-        if (ObjectHelper.isEmpty(endpoint.getConfiguration().getEcsClient())) {
-            LOG.debug("Looking for an EcsClient instance in the registry");
-            Set<EcsClient> clients = getCamelContext().getRegistry().findByType(EcsClient.class);
-            if (clients.size() == 1) {
-                LOG.debug("Found exactly one EcsClient instance in the registry");
-                configuration.setEcsClient(clients.stream().findFirst().get());
-            } else {
-                LOG.debug("No EcsClient instance in the registry");
-            }
-        } else {
-            LOG.debug("EcsClient instance is already set at endpoint level: skipping the check in the registry");
-        }
-    }
 }
diff --git a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java
index a093577..20af541 100644
--- a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java
+++ b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java
@@ -31,6 +31,7 @@ public class ECS2Configuration implements Cloneable {
     @Metadata(required = true)
     private String label;
     @UriParam
+    @Metadata(autowired = true)
     private EcsClient ecsClient;
     @UriParam(label = "security", secret = true)
     private String accessKey;
@@ -51,8 +52,6 @@ public class ECS2Configuration implements Cloneable {
     private boolean pojoRequest;
     @UriParam(defaultValue = "false")
     private boolean trustAllCertificates;
-    @UriParam(label = "common", defaultValue = "true")
-    private boolean autoDiscoverClient = true;
 
     public EcsClient getEcsClient() {
         return ecsClient;
@@ -165,18 +164,6 @@ public class ECS2Configuration implements Cloneable {
         this.trustAllCertificates = trustAllCertificates;
     }
 
-    public boolean isAutoDiscoverClient() {
-        return autoDiscoverClient;
-    }
-
-    /**
-     * Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry
-     * automatically otherwise it will skip that checking.
-     */
-    public void setAutoDiscoverClient(boolean autoDiscoverClient) {
-        this.autoDiscoverClient = autoDiscoverClient;
-    }
-
     // *************************************************
     //
     // *************************************************


[camel] 04/06: CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, additional test

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 fc9a7a35322d6a808e428c8e37e7f3565e9b91f0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Nov 16 07:58:25 2020 +0100

    CAMEL-15836 - Camel-AWS2-ECS: enable autowire on the ECS client, additional test
---
 .../component/aws2/ecs/ECS2ComponentClientRegistryTest.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
index b7f92b5..bd552d8 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentClientRegistryTest.java
@@ -55,4 +55,15 @@ public class ECS2ComponentClientRegistryTest extends CamelTestSupport {
 
         assertSame(clientMock, endpoint.getConfiguration().getEcsClient());
     }
+    
+    @Test
+    public void createEndpointWithAutowireAndNoCreds() throws Exception {
+
+        AmazonECSClientMock clientMock = new AmazonECSClientMock();
+        context.getRegistry().bind("amazonEcsClient", clientMock);
+        ECS2Component component = context.getComponent("aws2-ecs", ECS2Component.class);
+        ECS2Endpoint endpoint = (ECS2Endpoint) component.createEndpoint("aws2-ecs://TestDomain");
+
+        assertSame(clientMock, endpoint.getConfiguration().getEcsClient());
+    }
 }