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/01/27 14:26:50 UTC

[camel] 02/10: CAMEL-14446 - Create an AWS-ECS component based on SDK v2 - Fixed CS

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 7f19e3203d45fff7034e4e3652cf2ede5731894a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Jan 27 13:25:21 2020 +0100

    CAMEL-14446 - Create an AWS-ECS component based on SDK v2 - Fixed CS
---
 .../camel/component/aws2/ecs/ECS2Component.java    | 14 ++++----
 .../component/aws2/ecs/ECS2Configuration.java      |  9 ++---
 .../camel/component/aws2/ecs/ECS2Constants.java    |  6 ++--
 .../camel/component/aws2/ecs/ECS2Endpoint.java     |  2 +-
 .../camel/component/aws2/ecs/ECS2Operations.java   |  5 +--
 .../camel/component/aws2/ecs/ECS2Producer.java     | 20 ++++++------
 .../component/aws2/ecs/AmazonECSClientMock.java    | 33 +++++++++----------
 .../aws2/ecs/ECSComponentClientRegistryTest.java   |  2 +-
 .../aws2/ecs/ECSComponentConfigurationTest.java    | 16 ++++-----
 .../component/aws2/ecs/ECSProducerSpringTest.java  | 22 ++++++-------
 .../camel/component/aws2/ecs/ECSProducerTest.java  | 38 +++++++++-------------
 11 files changed, 78 insertions(+), 89 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 de3df20..c71f4ef 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
@@ -39,16 +39,16 @@ public class ECS2Component extends DefaultComponent {
     private String secretKey;
     @Metadata
     private String region;
-    @Metadata(label = "advanced")    
+    @Metadata(label = "advanced")
     private ECS2Configuration configuration;
-    
+
     public ECS2Component() {
         this(null);
     }
-    
+
     public ECS2Component(CamelContext context) {
         super(context);
-        
+
         registerExtension(new ECS2ComponentVerifierExtension());
     }
 
@@ -64,10 +64,10 @@ public class ECS2Component extends DefaultComponent {
         if (configuration.getEcsClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("Amazon ecs client or accessKey and secretKey must be specified");
         }
-      
+
         return endpoint;
     }
-    
+
     public ECS2Configuration getConfiguration() {
         return configuration;
     }
@@ -100,7 +100,7 @@ public class ECS2Component extends DefaultComponent {
     public void setSecretKey(String secretKey) {
         this.secretKey = secretKey;
     }
-    
+
     public String getRegion() {
         return region;
     }
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 31fed9e..5077031 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
@@ -92,7 +92,7 @@ public class ECS2Configuration implements Cloneable {
     public void setOperation(ECS2Operations operation) {
         this.operation = operation;
     }
-    
+
     public Protocol getProxyProtocol() {
         return proxyProtocol;
     }
@@ -131,13 +131,14 @@ public class ECS2Configuration implements Cloneable {
     }
 
     /**
-     * The region in which ECS 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()
+     * The region in which ECS 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()
      */
     public void setRegion(String region) {
         this.region = region;
     }
-    
+
     // *************************************************
     //
     // *************************************************
diff --git a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Constants.java b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Constants.java
index d8d2d56..963408c 100644
--- a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Constants.java
+++ b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Constants.java
@@ -20,7 +20,7 @@ package org.apache.camel.component.aws2.ecs;
  * Constants used in Camel AWS ECS module
  */
 public interface ECS2Constants {
-    String OPERATION                = "CamelAwsECSOperation";
-    String MAX_RESULTS              = "CamelAwsECSMaxResults";
-    String CLUSTER_NAME             = "CamelAwsECSClusterName";
+    String OPERATION = "CamelAwsECSOperation";
+    String MAX_RESULTS = "CamelAwsECSMaxResults";
+    String CLUSTER_NAME = "CamelAwsECSClusterName";
 }
diff --git a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
index 987d7a6..8837805 100644
--- a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
+++ b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
@@ -67,7 +67,7 @@ public class ECS2Endpoint extends ScheduledPollEndpoint {
 
         ecsClient = configuration.getEcsClient() != null ? configuration.getEcsClient() : createECSClient();
     }
-    
+
     @Override
     public void doStop() throws Exception {
         if (ObjectHelper.isEmpty(configuration.getEcsClient())) {
diff --git a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Operations.java b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Operations.java
index 9b2fa34..09930f8 100644
--- a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Operations.java
+++ b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Operations.java
@@ -18,8 +18,5 @@ package org.apache.camel.component.aws2.ecs;
 
 public enum ECS2Operations {
 
-    listClusters,
-    describeCluster,
-    createCluster,
-    deleteCluster
+    listClusters, describeCluster, createCluster, deleteCluster
 }
diff --git a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Producer.java b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Producer.java
index 7070b45..49215fa 100644
--- a/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Producer.java
+++ b/components/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Producer.java
@@ -104,7 +104,7 @@ public class ECS2Producer extends DefaultProducer {
         }
         ListClustersResponse result;
         try {
-        	ListClustersRequest request = builder.build();
+            ListClustersRequest request = builder.build();
             result = ecsClient.listClusters(request);
         } catch (AwsServiceException ase) {
             LOG.trace("List Clusters command returned the error code {}", ase.getMessage());
@@ -113,16 +113,16 @@ public class ECS2Producer extends DefaultProducer {
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
     }
-    
+
     private void createCluster(EcsClient ecsClient, Exchange exchange) {
-    	CreateClusterRequest.Builder builder = CreateClusterRequest.builder();
+        CreateClusterRequest.Builder builder = CreateClusterRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(ECS2Constants.CLUSTER_NAME))) {
             String name = exchange.getIn().getHeader(ECS2Constants.CLUSTER_NAME, String.class);
             builder.clusterName(name);
         }
         CreateClusterResponse result;
         try {
-        	CreateClusterRequest request = builder.build();
+            CreateClusterRequest request = builder.build();
             result = ecsClient.createCluster(request);
         } catch (AwsServiceException ase) {
             LOG.trace("Create Cluster command returned the error code {}", ase.getMessage());
@@ -131,16 +131,16 @@ public class ECS2Producer extends DefaultProducer {
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
     }
-    
+
     private void describeCluster(EcsClient ecsClient, Exchange exchange) {
         DescribeClustersRequest.Builder builder = DescribeClustersRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(ECS2Constants.CLUSTER_NAME))) {
             String clusterName = exchange.getIn().getHeader(ECS2Constants.CLUSTER_NAME, String.class);
             builder.clusters(clusterName);
-        } 
+        }
         DescribeClustersResponse result;
         try {
-        	DescribeClustersRequest request = builder.build();
+            DescribeClustersRequest request = builder.build();
             result = ecsClient.describeClusters(request);
         } catch (AwsServiceException ase) {
             LOG.trace("Describe Clusters command returned the error code {}", ase.getMessage());
@@ -149,7 +149,7 @@ public class ECS2Producer extends DefaultProducer {
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
     }
-    
+
     private void deleteCluster(EcsClient ecsClient, Exchange exchange) {
         DeleteClusterRequest.Builder builder = DeleteClusterRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(ECS2Constants.CLUSTER_NAME))) {
@@ -160,7 +160,7 @@ public class ECS2Producer extends DefaultProducer {
         }
         DeleteClusterResponse result;
         try {
-        	DeleteClusterRequest request = builder.build();
+            DeleteClusterRequest request = builder.build();
             result = ecsClient.deleteCluster(request);
         } catch (AwsServiceException ase) {
             LOG.trace("Delete Cluster command returned the error code {}", ase.getMessage());
@@ -169,7 +169,7 @@ public class ECS2Producer extends DefaultProducer {
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
     }
-    
+
     public static Message getMessageForResponse(final Exchange exchange) {
         return exchange.getMessage();
     }
diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/AmazonECSClientMock.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/AmazonECSClientMock.java
index 23ea17a..375ad34 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/AmazonECSClientMock.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/AmazonECSClientMock.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-
 import software.amazon.awssdk.services.ecs.EcsClient;
 import software.amazon.awssdk.services.ecs.model.Cluster;
 import software.amazon.awssdk.services.ecs.model.CreateClusterRequest;
@@ -36,10 +35,10 @@ public class AmazonECSClientMock implements EcsClient {
 
     public AmazonECSClientMock() {
     }
-    
+
     @Override
     public CreateClusterResponse createCluster(CreateClusterRequest request) {
-    	CreateClusterResponse.Builder res = CreateClusterResponse.builder();
+        CreateClusterResponse.Builder res = CreateClusterResponse.builder();
         Cluster cluster = Cluster.builder().clusterName("Test").build();
         res.cluster(cluster);
         return res.build();
@@ -47,7 +46,7 @@ public class AmazonECSClientMock implements EcsClient {
 
     @Override
     public DeleteClusterResponse deleteCluster(DeleteClusterRequest request) {
-    	DeleteClusterResponse.Builder res = DeleteClusterResponse.builder();
+        DeleteClusterResponse.Builder res = DeleteClusterResponse.builder();
         Cluster cluster = Cluster.builder().clusterName("Test").status("INACTIVE").build();
         res.cluster(cluster);
         return res.build();
@@ -55,30 +54,30 @@ public class AmazonECSClientMock implements EcsClient {
 
     @Override
     public DescribeClustersResponse describeClusters(DescribeClustersRequest request) {
-    	DescribeClustersResponse.Builder res = DescribeClustersResponse.builder();
+        DescribeClustersResponse.Builder res = DescribeClustersResponse.builder();
         Cluster cluster = Cluster.builder().clusterName("Test").status("INACTIVE").build();
         res.clusters(Collections.singleton(cluster));
-        return res.build();        
+        return res.build();
     }
 
     @Override
     public ListClustersResponse listClusters(ListClustersRequest request) {
-    	ListClustersResponse.Builder res = ListClustersResponse.builder();
+        ListClustersResponse.Builder res = ListClustersResponse.builder();
         List<String> list = new ArrayList<>();
         list.add("Test");
         res.clusterArns(list);
         return res.build();
     }
 
-	@Override
-	public String serviceName() {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    @Override
+    public String serviceName() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void close() {
+        // TODO Auto-generated method stub
 
-	@Override
-	public void close() {
-		// TODO Auto-generated method stub
-		
-	}
+    }
 }
diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentClientRegistryTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentClientRegistryTest.java
index e6606f4..a08af05 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentClientRegistryTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentClientRegistryTest.java
@@ -33,7 +33,7 @@ public class ECSComponentClientRegistryTest extends CamelTestSupport {
 
         assertNotNull(endpoint.getConfiguration().getEcsClient());
     }
-    
+
     @Test(expected = IllegalArgumentException.class)
     public void createEndpointWithMinimalECSClientMisconfiguration() throws Exception {
 
diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentConfigurationTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentConfigurationTest.java
index 6ddf23b..e87cca4 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentConfigurationTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSComponentConfigurationTest.java
@@ -26,18 +26,17 @@ import software.amazon.awssdk.regions.Region;
 
 public class ECSComponentConfigurationTest extends CamelTestSupport {
 
-    
     @Test
     public void createEndpointWithComponentElements() throws Exception {
         ECS2Component component = context.getComponent("aws2-ecs", ECS2Component.class);
         component.setAccessKey("XXX");
         component.setSecretKey("YYY");
         ECS2Endpoint endpoint = (ECS2Endpoint)component.createEndpoint("aws2-ecs://label");
-        
+
         assertEquals("XXX", endpoint.getConfiguration().getAccessKey());
         assertEquals("YYY", endpoint.getConfiguration().getSecretKey());
     }
-    
+
     @Test
     public void createEndpointWithComponentAndEndpointElements() throws Exception {
         ECS2Component component = context.getComponent("aws2-ecs", ECS2Component.class);
@@ -45,20 +44,21 @@ public class ECSComponentConfigurationTest extends CamelTestSupport {
         component.setSecretKey("YYY");
         component.setRegion(Region.US_WEST_1.toString());
         ECS2Endpoint endpoint = (ECS2Endpoint)component.createEndpoint("aws2-ecs://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1");
-        
+
         assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
         assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey());
         assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion());
     }
-    
+
     @Test
     public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception {
         ECS2Component component = context.getComponent("aws2-ecs", ECS2Component.class);
         component.setAccessKey("XXX");
         component.setSecretKey("YYY");
         component.setRegion(Region.US_WEST_1.toString());
-        ECS2Endpoint endpoint = (ECS2Endpoint)component.createEndpoint("aws2-ecs://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP");
-        
+        ECS2Endpoint endpoint = (ECS2Endpoint)component
+            .createEndpoint("aws2-ecs://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP");
+
         assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
         assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey());
         assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion());
@@ -66,5 +66,5 @@ public class ECSComponentConfigurationTest extends CamelTestSupport {
         assertEquals("localhost", endpoint.getConfiguration().getProxyHost());
         assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort());
     }
-    
+
 }
diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerSpringTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerSpringTest.java
index 2874391..89841a8 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerSpringTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerSpringTest.java
@@ -32,10 +32,10 @@ import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class ECSProducerSpringTest extends CamelSpringTestSupport {
-    
+
     @EndpointInject("mock:result")
     private MockEndpoint mock;
-    
+
     @Test
     public void kmsListClustersTest() throws Exception {
 
@@ -48,12 +48,12 @@ public class ECSProducerSpringTest extends CamelSpringTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
-        ListClustersResponse resultGet = (ListClustersResponse) exchange.getIn().getBody();
+
+        ListClustersResponse resultGet = (ListClustersResponse)exchange.getIn().getBody();
         assertEquals(1, resultGet.clusterArns().size());
         assertEquals("Test", resultGet.clusterArns().get(0));
     }
-    
+
     @Test
     public void ecsCreateClusterTest() throws Exception {
 
@@ -67,11 +67,11 @@ public class ECSProducerSpringTest extends CamelSpringTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
-        CreateClusterResponse resultGet = (CreateClusterResponse) exchange.getIn().getBody();
+
+        CreateClusterResponse resultGet = (CreateClusterResponse)exchange.getIn().getBody();
         assertEquals("Test", resultGet.cluster().clusterName());
     }
-    
+
     @Test
     public void eksDescribeClusterTest() throws Exception {
 
@@ -85,11 +85,11 @@ public class ECSProducerSpringTest extends CamelSpringTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
+
         DescribeClustersResponse resultGet = exchange.getIn().getBody(DescribeClustersResponse.class);
         assertEquals("Test", resultGet.clusters().get(0).clusterName());
     }
-    
+
     @Test
     public void eksDeleteClusterTest() throws Exception {
 
@@ -103,7 +103,7 @@ public class ECSProducerSpringTest extends CamelSpringTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
+
         DeleteClusterResponse resultGet = exchange.getIn().getBody(DeleteClusterResponse.class);
         assertEquals("Test", resultGet.cluster().clusterName());
     }
diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerTest.java
index ee20532..ee6973b 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECSProducerTest.java
@@ -36,10 +36,10 @@ public class ECSProducerTest extends CamelTestSupport {
 
     @BindToRegistry("amazonEcsClient")
     AmazonECSClientMock clientMock = new AmazonECSClientMock();
-    
+
     @EndpointInject("mock:result")
     private MockEndpoint mock;
-    
+
     @Test
     public void kmsListClustersTest() throws Exception {
 
@@ -52,12 +52,12 @@ public class ECSProducerTest extends CamelTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
-        ListClustersResponse resultGet = (ListClustersResponse) exchange.getIn().getBody();
+
+        ListClustersResponse resultGet = (ListClustersResponse)exchange.getIn().getBody();
         assertEquals(1, resultGet.clusterArns().size());
         assertEquals("Test", resultGet.clusterArns().get(0));
     }
-    
+
     @Test
     public void ecsCreateClusterTest() throws Exception {
 
@@ -71,11 +71,11 @@ public class ECSProducerTest extends CamelTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
-        CreateClusterResponse resultGet = (CreateClusterResponse) exchange.getIn().getBody();
+
+        CreateClusterResponse resultGet = (CreateClusterResponse)exchange.getIn().getBody();
         assertEquals("Test", resultGet.cluster().clusterName());
     }
-    
+
     @Test
     public void eksDescribeClusterTest() throws Exception {
 
@@ -89,11 +89,11 @@ public class ECSProducerTest extends CamelTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
+
         DescribeClustersResponse resultGet = exchange.getIn().getBody(DescribeClustersResponse.class);
         assertEquals("Test", resultGet.clusters().get(0).clusterName());
     }
-    
+
     @Test
     public void eksDeleteClusterTest() throws Exception {
 
@@ -107,7 +107,7 @@ public class ECSProducerTest extends CamelTestSupport {
         });
 
         assertMockEndpointsSatisfied();
-        
+
         DeleteClusterResponse resultGet = exchange.getIn().getBody(DeleteClusterResponse.class);
         assertEquals("Test", resultGet.cluster().clusterName());
     }
@@ -117,18 +117,10 @@ public class ECSProducerTest extends CamelTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:listClusters")
-                    .to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=listClusters")
-                    .to("mock:result");
-                from("direct:createCluster")
-                    .to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=createCluster")
-                    .to("mock:result");
-                from("direct:deleteCluster")
-                    .to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=deleteCluster")
-                    .to("mock:result");
-                from("direct:describeCluster")
-                    .to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=describeCluster")
-                    .to("mock:result");
+                from("direct:listClusters").to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=listClusters").to("mock:result");
+                from("direct:createCluster").to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=createCluster").to("mock:result");
+                from("direct:deleteCluster").to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=deleteCluster").to("mock:result");
+                from("direct:describeCluster").to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=describeCluster").to("mock:result");
             }
         };
     }