camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [04/20] camel git commit: Fixes reported checkstyle errors.
Date Mon, 27 Mar 2017 07:49:22 GMT
http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanSnapshotsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanSnapshotsProducer.java
b/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanSnapshotsProducer.java
index fb70703..5302fdf 100644
--- a/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanSnapshotsProducer.java
+++ b/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanSnapshotsProducer.java
@@ -19,11 +19,11 @@ package org.apache.camel.component.digitalocean.producer;
 import com.myjeeva.digitalocean.pojo.Delete;
 import com.myjeeva.digitalocean.pojo.Snapshot;
 import com.myjeeva.digitalocean.pojo.Snapshots;
+import org.apache.camel.Exchange;
 import org.apache.camel.component.digitalocean.DigitalOceanConfiguration;
 import org.apache.camel.component.digitalocean.DigitalOceanEndpoint;
 import org.apache.camel.component.digitalocean.constants.DigitalOceanHeaders;
 import org.apache.camel.component.digitalocean.constants.DigitalOceanSnapshotTypes;
-import org.apache.camel.Exchange;
 import org.apache.camel.util.ObjectHelper;
 
 /**
@@ -39,18 +39,18 @@ public class DigitalOceanSnapshotsProducer extends DigitalOceanProducer
{
 
         switch (determineOperation(exchange)) {
 
-            case list:
-                getSnapshots(exchange);
-                break;
-            case get:
-                getSnapshot(exchange);
-                break;
-            case delete:
-                deleteSnapshot(exchange);
-                break;
-
-            default:
-                throw new IllegalArgumentException("Unsupported operation");
+        case list:
+            getSnapshots(exchange);
+            break;
+        case get:
+            getSnapshot(exchange);
+            break;
+        case delete:
+            deleteSnapshot(exchange);
+            break;
+
+        default:
+            throw new IllegalArgumentException("Unsupported operation");
         }
 
 
@@ -61,13 +61,15 @@ public class DigitalOceanSnapshotsProducer extends DigitalOceanProducer
{
         DigitalOceanSnapshotTypes type = exchange.getIn().getHeader(DigitalOceanHeaders.TYPE,
DigitalOceanSnapshotTypes.class);
         Snapshots snapshots;
 
-        if (ObjectHelper.isNotEmpty(type))
-            if(type == DigitalOceanSnapshotTypes.droplet)
+        if (ObjectHelper.isNotEmpty(type)) {
+            if (type == DigitalOceanSnapshotTypes.droplet) {
                 snapshots = getEndpoint().getDigitalOceanClient().getAllDropletSnapshots(configuration.getPage(),
configuration.getPerPage());
-            else
+            } else {
                 snapshots = getEndpoint().getDigitalOceanClient().getAllVolumeSnapshots(configuration.getPage(),
configuration.getPerPage());
-        else
+            }
+        } else {
             snapshots = getEndpoint().getDigitalOceanClient().getAvailableSnapshots(configuration.getPage(),
configuration.getPerPage());
+        }
 
         LOG.trace("All Snapshots : page {} / {} per page [{}] ", configuration.getPage(),
configuration.getPerPage(), snapshots.getSnapshots());
         exchange.getOut().setBody(snapshots.getSnapshots());
@@ -76,8 +78,9 @@ public class DigitalOceanSnapshotsProducer extends DigitalOceanProducer
{
     private void getSnapshot(Exchange exchange) throws Exception {
         String snapshotId = exchange.getIn().getHeader(DigitalOceanHeaders.ID, String.class);
 
-        if (ObjectHelper.isEmpty(snapshotId))
+        if (ObjectHelper.isEmpty(snapshotId)) {
             throw new IllegalArgumentException(DigitalOceanHeaders.ID + " must be specified");
+        }
 
         Snapshot snapshot = getEndpoint().getDigitalOceanClient().getSnaphotInfo(snapshotId);
         LOG.trace("Snapshot [{}] ", snapshot);
@@ -88,8 +91,9 @@ public class DigitalOceanSnapshotsProducer extends DigitalOceanProducer
{
     private void deleteSnapshot(Exchange exchange) throws Exception {
         String snapshotId = exchange.getIn().getHeader(DigitalOceanHeaders.ID, String.class);
 
-        if (ObjectHelper.isEmpty(snapshotId))
+        if (ObjectHelper.isEmpty(snapshotId)) {
             throw new IllegalArgumentException(DigitalOceanHeaders.ID + " must be specified");
+        }
 
         Delete delete = getEndpoint().getDigitalOceanClient().deleteSnapshot(snapshotId);
         LOG.trace("Delete Snapshot [{}] ", delete);

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanTagsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanTagsProducer.java
b/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanTagsProducer.java
index 7b6777c..d8d9d12 100644
--- a/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanTagsProducer.java
+++ b/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/producer/DigitalOceanTagsProducer.java
@@ -16,12 +16,13 @@
  */
 package org.apache.camel.component.digitalocean.producer;
 
-import com.myjeeva.digitalocean.pojo.*;
+import com.myjeeva.digitalocean.pojo.Delete;
+import com.myjeeva.digitalocean.pojo.Tag;
+import com.myjeeva.digitalocean.pojo.Tags;
+import org.apache.camel.Exchange;
 import org.apache.camel.component.digitalocean.DigitalOceanConfiguration;
-import org.apache.camel.component.digitalocean.constants.DigitalOceanHeaders;
 import org.apache.camel.component.digitalocean.DigitalOceanEndpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.component.digitalocean.constants.DigitalOceanOperations;
+import org.apache.camel.component.digitalocean.constants.DigitalOceanHeaders;
 import org.apache.camel.util.ObjectHelper;
 
 /**
@@ -34,25 +35,24 @@ public class DigitalOceanTagsProducer extends DigitalOceanProducer {
     }
 
     public void process(Exchange exchange) throws Exception {
-        switch(determineOperation(exchange)) {
-
-            case list:
-                getTags(exchange);
-                break;
-            case create:
-                createTag(exchange);
-                break;
-            case get:
-                getTag(exchange);
-                break;
-            case delete:
-                deleteTag(exchange);
-                break;
-            case update:
-                updateTag(exchange);
-                break;
-            default:
-                throw new IllegalArgumentException("Unsupported operation");
+        switch (determineOperation(exchange)) {
+        case list:
+            getTags(exchange);
+            break;
+        case create:
+            createTag(exchange);
+            break;
+        case get:
+            getTag(exchange);
+            break;
+        case delete:
+            deleteTag(exchange);
+            break;
+        case update:
+            updateTag(exchange);
+            break;
+        default:
+            throw new IllegalArgumentException("Unsupported operation");
         }
 
     }
@@ -60,8 +60,9 @@ public class DigitalOceanTagsProducer extends DigitalOceanProducer {
     private void createTag(Exchange exchange) throws Exception {
         String name = exchange.getIn().getHeader(DigitalOceanHeaders.NAME, String.class);
 
-        if (ObjectHelper.isEmpty(name))
+        if (ObjectHelper.isEmpty(name)) {
             throw new IllegalArgumentException(DigitalOceanHeaders.NAME + " must be specified");
+        }
         Tag tag = getEndpoint().getDigitalOceanClient().createTag(name);
         LOG.trace("Create Tag [{}] ", tag);
         exchange.getOut().setBody(tag);
@@ -71,8 +72,9 @@ public class DigitalOceanTagsProducer extends DigitalOceanProducer {
     private void getTag(Exchange exchange) throws Exception {
         String name = exchange.getIn().getHeader(DigitalOceanHeaders.NAME, String.class);
 
-        if (ObjectHelper.isEmpty(name))
+        if (ObjectHelper.isEmpty(name)) {
             throw new IllegalArgumentException(DigitalOceanHeaders.NAME + " must be specified");
+        }
         Tag tag = getEndpoint().getDigitalOceanClient().getTag(name);
         LOG.trace("Tag [{}] ", tag);
         exchange.getOut().setBody(tag);
@@ -87,8 +89,9 @@ public class DigitalOceanTagsProducer extends DigitalOceanProducer {
     private void deleteTag(Exchange exchange) throws Exception {
         String name = exchange.getIn().getHeader(DigitalOceanHeaders.NAME, String.class);
 
-        if (ObjectHelper.isEmpty(name))
+        if (ObjectHelper.isEmpty(name)) {
             throw new IllegalArgumentException(DigitalOceanHeaders.NAME + " must be specified");
+        }
         Delete delete = getEndpoint().getDigitalOceanClient().deleteTag(name);
         LOG.trace("Delete Tag [{}] ", delete);
         exchange.getOut().setBody(delete);
@@ -97,14 +100,15 @@ public class DigitalOceanTagsProducer extends DigitalOceanProducer {
     private void updateTag(Exchange exchange) throws Exception {
         String name = exchange.getIn().getHeader(DigitalOceanHeaders.NAME, String.class);
 
-        if (ObjectHelper.isEmpty(name))
+        if (ObjectHelper.isEmpty(name)) {
             throw new IllegalArgumentException(DigitalOceanHeaders.NAME + " must be specified");
-
+        }
 
         String newName = exchange.getIn().getHeader(DigitalOceanHeaders.NEW_NAME, String.class);
 
-        if (ObjectHelper.isEmpty(newName))
+        if (ObjectHelper.isEmpty(newName)) {
             throw new IllegalArgumentException(DigitalOceanHeaders.NEW_NAME + " must be specified");
+        }
 
         Tag tag = getEndpoint().getDigitalOceanClient().updateTag(name, newName);
         LOG.trace("Update Tag [{}] ", tag);

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/main/resources/log4j2.properties
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/main/resources/log4j2.properties b/components/camel-digitalocean/src/main/resources/log4j2.properties
index 60e86f8..8daffa6 100644
--- a/components/camel-digitalocean/src/main/resources/log4j2.properties
+++ b/components/camel-digitalocean/src/main/resources/log4j2.properties
@@ -14,10 +14,9 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-
-appender.out.type = Console
-appender.out.name = out
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
-rootLogger.level = DEBUG
-rootLogger.appenderRef.out.ref = out
+appender.out.type=Console
+appender.out.name=out
+appender.out.layout.type=PatternLayout
+appender.out.layout.pattern=[%30.30t] %-30.30c{1} %-5p %m%n
+rootLogger.level=DEBUG
+rootLogger.appenderRef.out.ref=out

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanClientMock.java
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanClientMock.java
b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanClientMock.java
index 2bb8c8b..769c628 100644
--- a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanClientMock.java
+++ b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanClientMock.java
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.digitalocean;
 
 import com.myjeeva.digitalocean.exception.DigitalOceanException;
@@ -5,13 +21,9 @@ import com.myjeeva.digitalocean.exception.RequestUnsuccessfulException;
 import com.myjeeva.digitalocean.impl.DigitalOceanClient;
 import com.myjeeva.digitalocean.pojo.Account;
 
-/**
- * Created by thomas on 17/03/2017.
- */
 public class DigitalOceanClientMock extends DigitalOceanClient {
 
 
-
     public DigitalOceanClientMock() {
         super("token");
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanComponentTest.java
b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanComponentTest.java
index 5f0d85d..ce5a37f 100644
--- a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanComponentTest.java
+++ b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/DigitalOceanComponentTest.java
@@ -1,12 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.digitalocean;
 
 import com.myjeeva.digitalocean.impl.DigitalOceanClient;
 import com.myjeeva.digitalocean.pojo.Account;
-import org.apache.camel.component.digitalocean.constants.DigitalOceanHeaders;
-import org.apache.camel.component.digitalocean.constants.DigitalOceanOperations;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.digitalocean.constants.DigitalOceanHeaders;
+import org.apache.camel.component.digitalocean.constants.DigitalOceanOperations;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
@@ -15,22 +31,21 @@ import org.junit.Test;
 public class DigitalOceanComponentTest extends CamelTestSupport {
 
 
+    @EndpointInject(uri = "mock:result")
+    protected MockEndpoint mockResultEndpoint;
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() {
                 from("direct:getAccountInfo")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
-                        .to("digitalocean:account?digitalOceanClient=#digitalOceanClient")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
+                    .to("digitalocean:account?digitalOceanClient=#digitalOceanClient")
+                    .to("mock:result");
             }
         };
     }
 
-    @EndpointInject(uri = "mock:result")
-    protected MockEndpoint mockResultEndpoint;
-
     @Test
     public void testGetAccountInfo() throws Exception {
 
@@ -42,8 +57,6 @@ public class DigitalOceanComponentTest extends CamelTestSupport {
     }
 
 
-
-
     @Override
     protected JndiRegistry createRegistry() throws Exception {
         JndiRegistry registry = super.createRegistry();

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanComponentIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanComponentIntegrationTest.java
b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanComponentIntegrationTest.java
index c258c81..8fed264 100644
--- a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanComponentIntegrationTest.java
+++ b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanComponentIntegrationTest.java
@@ -1,23 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.digitalocean.integration;
 
-import com.myjeeva.digitalocean.pojo.*;
-import org.apache.camel.component.digitalocean.constants.DigitalOceanHeaders;
-import org.apache.camel.component.digitalocean.constants.DigitalOceanOperations;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import com.myjeeva.digitalocean.pojo.Account;
+import com.myjeeva.digitalocean.pojo.Action;
+import com.myjeeva.digitalocean.pojo.Droplet;
+import com.myjeeva.digitalocean.pojo.Image;
+import com.myjeeva.digitalocean.pojo.Region;
+import com.myjeeva.digitalocean.pojo.Size;
+import com.myjeeva.digitalocean.pojo.Tag;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.digitalocean.constants.DigitalOceanHeaders;
+import org.apache.camel.component.digitalocean.constants.DigitalOceanOperations;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
 
 @Ignore("Must be manually tested. Provide your own oAuthToken")
 public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSupport {
 
+    @EndpointInject(uri = "mock:result")
+    protected MockEndpoint mockResultEndpoint;
+
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
@@ -28,138 +53,135 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
                     .to("mock:result");
 
                 from("direct:getAccountInfo2")
-                        .to("digitalocean:account?operation="+DigitalOceanOperations.get+"&oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .to("digitalocean:account?operation=" + DigitalOceanOperations.get +
"&oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getActions")
-                        .to("digitalocean:actions?operation=list&oAuthToken={{oAuthToken}}&perPage=30")
-                        .to("mock:result");
+                    .to("digitalocean:actions?operation=list&oAuthToken={{oAuthToken}}&perPage=30")
+                    .to("mock:result");
 
                 from("direct:getActionInfo")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
-                        .setHeader(DigitalOceanHeaders.ID, constant(133459716))
-                        .to("digitalocean:actions?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
+                    .setHeader(DigitalOceanHeaders.ID, constant(133459716))
+                    .to("digitalocean:actions?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
 
                 from("direct:getDroplets")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
-                        .to("digitalocean:droplets?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
+                    .to("digitalocean:droplets?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getDroplet")
-                        .setHeader(DigitalOceanHeaders.ID, constant(5428878))
-                        .to("digitalocean:droplets?operation=get&oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.ID, constant(5428878))
+                    .to("digitalocean:droplets?operation=get&oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getDroplet2")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
-                        .setHeader(DigitalOceanHeaders.ID, constant(5428878))
-                        .to("digitalocean:droplets?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
+                    .setHeader(DigitalOceanHeaders.ID, constant(5428878))
+                    .to("digitalocean:droplets?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:createDroplet")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.create))
-                        .setHeader(DigitalOceanHeaders.NAME, constant("camel-test"))
-                        .setHeader(DigitalOceanHeaders.REGION, constant("fra1"))
-                        .setHeader(DigitalOceanHeaders.DROPLET_IMAGE, constant("ubuntu-14-04-x64"))
-                        .setHeader(DigitalOceanHeaders.DROPLET_SIZE, constant("512mb"))
-                        .process(e -> {
-                            Collection<String> tags = new ArrayList<String>();
-                            tags.add("tag1");
-                            tags.add("tag2");
-                            e.getIn().setHeader(DigitalOceanHeaders.DROPLET_TAGS, tags);
-
-                        })
-                        .to("digitalocean:droplets?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.create))
+                    .setHeader(DigitalOceanHeaders.NAME, constant("camel-test"))
+                    .setHeader(DigitalOceanHeaders.REGION, constant("fra1"))
+                    .setHeader(DigitalOceanHeaders.DROPLET_IMAGE, constant("ubuntu-14-04-x64"))
+                    .setHeader(DigitalOceanHeaders.DROPLET_SIZE, constant("512mb"))
+                    .process(e -> {
+                        Collection<String> tags = new ArrayList<String>();
+                        tags.add("tag1");
+                        tags.add("tag2");
+                        e.getIn().setHeader(DigitalOceanHeaders.DROPLET_TAGS, tags);
+
+                    })
+                    .to("digitalocean:droplets?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:createMultipleDroplets")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.create))
-                        .process(e -> {
-                            Collection<String> names = new ArrayList<String>();
-                            names.add("droplet1");
-                            names.add("droplet2");
-                            e.getIn().setHeader(DigitalOceanHeaders.NAMES, names);
-
-                        })
-                        .setHeader(DigitalOceanHeaders.REGION, constant("fra1"))
-                        .setHeader(DigitalOceanHeaders.DROPLET_IMAGE, constant("ubuntu-14-04-x64"))
-                        .setHeader(DigitalOceanHeaders.DROPLET_SIZE, constant("512mb"))
-                        .process(e -> {
-                            Collection<String> tags = new ArrayList<String>();
-                            tags.add("tag1");
-                            tags.add("tag2");
-                            e.getIn().setHeader(DigitalOceanHeaders.DROPLET_TAGS, tags);
-
-                        })
-                        .to("digitalocean://droplets?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.create))
+                    .process(e -> {
+                        Collection<String> names = new ArrayList<String>();
+                        names.add("droplet1");
+                        names.add("droplet2");
+                        e.getIn().setHeader(DigitalOceanHeaders.NAMES, names);
+
+                    })
+                    .setHeader(DigitalOceanHeaders.REGION, constant("fra1"))
+                    .setHeader(DigitalOceanHeaders.DROPLET_IMAGE, constant("ubuntu-14-04-x64"))
+                    .setHeader(DigitalOceanHeaders.DROPLET_SIZE, constant("512mb"))
+                    .process(e -> {
+                        Collection<String> tags = new ArrayList<String>();
+                        tags.add("tag1");
+                        tags.add("tag2");
+                        e.getIn().setHeader(DigitalOceanHeaders.DROPLET_TAGS, tags);
+
+                    })
+                    .to("digitalocean://droplets?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getDropletBackups")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.listBackups))
-                        .setHeader(DigitalOceanHeaders.ID, constant(5428878))
-                        .to("digitalocean://droplets?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.listBackups))
+                    .setHeader(DigitalOceanHeaders.ID, constant(5428878))
+                    .to("digitalocean://droplets?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:createTag")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.create))
-                        .setHeader(DigitalOceanHeaders.NAME, constant("tag1"))
-                        .to("digitalocean://tags?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.create))
+                    .setHeader(DigitalOceanHeaders.NAME, constant("tag1"))
+                    .to("digitalocean://tags?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getTags")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
-                        .to("digitalocean://tags?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
+                    .to("digitalocean://tags?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getImages")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
-                        .to("digitalocean://images?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
+                    .to("digitalocean://images?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getImage")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
-                        .setHeader(DigitalOceanHeaders.DROPLET_IMAGE, constant("ubuntu-14-04-x64"))
-                        .to("digitalocean://images?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
+                    .setHeader(DigitalOceanHeaders.DROPLET_IMAGE, constant("ubuntu-14-04-x64"))
+                    .to("digitalocean://images?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getSizes")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
-                        .to("digitalocean://sizes?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
+                    .to("digitalocean://sizes?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getSize")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
-                        .setHeader(DigitalOceanHeaders.NAME, constant("512mb"))
-                        .to("digitalocean://sizes?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
+                    .setHeader(DigitalOceanHeaders.NAME, constant("512mb"))
+                    .to("digitalocean://sizes?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getRegions")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
-                        .to("digitalocean://regions?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.list))
+                    .to("digitalocean://regions?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
 
                 from("direct:getRegion")
-                        .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
-                        .setHeader(DigitalOceanHeaders.NAME, constant("nyc1"))
-                        .to("digitalocean://regions?oAuthToken={{oAuthToken}}")
-                        .to("mock:result");
+                    .setHeader(DigitalOceanHeaders.OPERATION, constant(DigitalOceanOperations.get))
+                    .setHeader(DigitalOceanHeaders.NAME, constant("nyc1"))
+                    .to("digitalocean://regions?oAuthToken={{oAuthToken}}")
+                    .to("mock:result");
             }
         };
     }
 
-    @EndpointInject(uri = "mock:result")
-    protected MockEndpoint mockResultEndpoint;
-
     @Test
     public void testGetAccountInfo() throws Exception {
         mockResultEndpoint.expectedMinimumMessageCount(2);
 
         Exchange exchange = template.request("direct:getAccountInfo", null);
-        assertTrue(((Account)exchange.getOut().getBody()).isEmailVerified());
+        assertTrue(((Account) exchange.getOut().getBody()).isEmailVerified());
         exchange = template.request("direct:getAccountInfo2", null);
-        assertTrue(((Account)exchange.getOut().getBody()).isEmailVerified());
+        assertTrue(((Account) exchange.getOut().getBody()).isEmailVerified());
 
         assertMockEndpointsSatisfied();
 
@@ -172,7 +194,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getActions", null);
 
         assertMockEndpointsSatisfied();
-        assertEquals(((List)exchange.getOut().getBody()).size(), 30);
+        assertEquals(((List) exchange.getOut().getBody()).size(), 30);
     }
 
     @Test
@@ -182,23 +204,22 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getActionInfo", null);
 
         assertMockEndpointsSatisfied();
-        assertEquals(((Action)exchange.getOut().getBody()).getId(), new Integer(133459716));
+        assertEquals(((Action) exchange.getOut().getBody()).getId(), new Integer(133459716));
     }
 
 
-
     @Test
     public void testGetDropletInfo() throws Exception {
         mockResultEndpoint.expectedMinimumMessageCount(2);
 
         Exchange exchange = template.request("direct:getDroplet", null);
 
-        assertEquals(((Droplet)exchange.getOut().getBody()).getId(), new Integer(5428878));
+        assertEquals(((Droplet) exchange.getOut().getBody()).getId(), new Integer(5428878));
 
         exchange = template.request("direct:getDroplet2", null);
 
         assertMockEndpointsSatisfied();
-        assertEquals(((Droplet)exchange.getOut().getBody()).getId(), new Integer(5428878));
+        assertEquals(((Droplet) exchange.getOut().getBody()).getId(), new Integer(5428878));
 
     }
 
@@ -210,7 +231,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:createDroplet", null);
 
         assertMockEndpointsSatisfied();
-        Droplet droplet = (Droplet)exchange.getOut().getBody();
+        Droplet droplet = (Droplet) exchange.getOut().getBody();
 
         assertNotNull(droplet.getId());
         assertEquals(droplet.getRegion().getSlug(), "fra1");
@@ -225,7 +246,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:createMultipleDroplets", null);
 
         assertMockEndpointsSatisfied();
-        List<Droplet> droplets = (List<Droplet>)exchange.getOut().getBody();
+        List<Droplet> droplets = (List<Droplet>) exchange.getOut().getBody();
 
         assertCollectionSize(droplets, 2);
     }
@@ -238,7 +259,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getDroplets", null);
 
         assertMockEndpointsSatisfied();
-        assertEquals(((List)exchange.getOut().getBody()).size(), 1);
+        assertEquals(((List) exchange.getOut().getBody()).size(), 1);
     }
 
     @Test
@@ -248,7 +269,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getDropletBackups", null);
 
         assertMockEndpointsSatisfied();
-        assertCollectionSize(((List)exchange.getOut().getBody()), 0);
+        assertCollectionSize((List) exchange.getOut().getBody(), 0);
     }
 
     @Test
@@ -258,7 +279,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:createTag", null);
 
         assertMockEndpointsSatisfied();
-        assertEquals(((Tag)exchange.getOut().getBody()).getName(), "tag1");
+        assertEquals(((Tag) exchange.getOut().getBody()).getName(), "tag1");
     }
 
 
@@ -269,7 +290,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getTags", null);
 
         assertMockEndpointsSatisfied();
-        assertEquals(((List<Tag>)exchange.getOut().getBody()).get(0).getName(), "tag1");
+        assertEquals(((List<Tag>) exchange.getOut().getBody()).get(0).getName(), "tag1");
     }
 
     @Test
@@ -279,7 +300,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getImages", null);
 
         assertMockEndpointsSatisfied();
-        List<Image> images = (List<Image>)exchange.getOut().getBody();
+        List<Image> images = (List<Image>) exchange.getOut().getBody();
         assertNotEquals(images.size(), 1);
     }
 
@@ -301,7 +322,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getSizes", null);
 
         assertMockEndpointsSatisfied();
-        List<Size> sizes = (List<Size>)exchange.getOut().getBody();
+        List<Size> sizes = (List<Size>) exchange.getOut().getBody();
         System.out.println(sizes);
         assertNotEquals(sizes.size(), 1);
     }
@@ -314,7 +335,7 @@ public class DigitalOceanComponentIntegrationTest extends DigitalOceanTestSuppor
         Exchange exchange = template.request("direct:getRegions", null);
 
         assertMockEndpointsSatisfied();
-        List<Region> regions = (List<Region>)exchange.getOut().getBody();
+        List<Region> regions = (List<Region>) exchange.getOut().getBody();
         System.out.println(regions);
         assertNotEquals(regions.size(), 1);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanTestSupport.java
b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanTestSupport.java
index 3c3ffd8..914437b 100644
--- a/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanTestSupport.java
+++ b/components/camel-digitalocean/src/test/java/org/apache/camel/component/digitalocean/integration/DigitalOceanTestSupport.java
@@ -1,15 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.digitalocean.integration;
 
-import java.util.Properties;
-import org.apache.camel.test.junit4.CamelTestSupport;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.Properties;
+
+import org.apache.camel.test.junit4.CamelTestSupport;
+
 
-/**
- * Created by thomas on 17/03/2017.
- */
 public class DigitalOceanTestSupport extends CamelTestSupport {
 
     protected final Properties properties;

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/test/resources/log4j2.properties
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/test/resources/log4j2.properties b/components/camel-digitalocean/src/test/resources/log4j2.properties
index 60e86f8..8daffa6 100644
--- a/components/camel-digitalocean/src/test/resources/log4j2.properties
+++ b/components/camel-digitalocean/src/test/resources/log4j2.properties
@@ -14,10 +14,9 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-
-appender.out.type = Console
-appender.out.name = out
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
-rootLogger.level = DEBUG
-rootLogger.appenderRef.out.ref = out
+appender.out.type=Console
+appender.out.name=out
+appender.out.layout.type=PatternLayout
+appender.out.layout.pattern=[%30.30t] %-30.30c{1} %-5p %m%n
+rootLogger.level=DEBUG
+rootLogger.appenderRef.out.ref=out

http://git-wip-us.apache.org/repos/asf/camel/blob/0dd2c2f2/components/camel-digitalocean/src/test/resources/test-options.properties
----------------------------------------------------------------------
diff --git a/components/camel-digitalocean/src/test/resources/test-options.properties b/components/camel-digitalocean/src/test/resources/test-options.properties
index 549de90..acae91a 100644
--- a/components/camel-digitalocean/src/test/resources/test-options.properties
+++ b/components/camel-digitalocean/src/test/resources/test-options.properties
@@ -14,5 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-
 oAuthToken=<yourOAuthToken>
\ No newline at end of file


Mime
View raw message