camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/5] camel git commit: CAMEL-8371 Improvements and enhancements to camel-docker component and updated to support docker-java 0.10.5
Date Mon, 23 Feb 2015 07:10:24 GMT
Repository: camel
Updated Branches:
  refs/heads/master eb86ec62c -> 2f5626df6


http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/DockerClientProfileRegistryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/DockerClientProfileRegistryTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/DockerClientProfileRegistryTest.java
new file mode 100644
index 0000000..01e56f7
--- /dev/null
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/DockerClientProfileRegistryTest.java
@@ -0,0 +1,65 @@
+/**
+ * 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.docker;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.impl.PropertyPlaceholderDelegateRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+/**
+ * Validates a {@link DockerClientProfile} is bound from the Camel registry
+ */
+@RunWith(PowerMockRunner.class)
+public class DockerClientProfileRegistryTest extends CamelTestSupport {
+        
+    
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext camelContext = super.createCamelContext();
+
+        DockerClientProfile profile = new DockerClientProfile();
+        profile.setHost("192.168.59.103");
+        profile.setPort(2376);
+        profile.setSecure(true);
+        profile.setCertPath("/Users/cameluser/.boot2docker/certs/boot2docker-vm");
+        
+        PropertyPlaceholderDelegateRegistry registry = (PropertyPlaceholderDelegateRegistry) camelContext.getRegistry();
+        JndiRegistry jndiRegistry = (JndiRegistry)registry.getRegistry();
+        jndiRegistry.bind("dockerProfile", profile);
+        
+        
+        return camelContext;
+    }
+    
+    @Test
+    public void clientProfileTest() {
+        DockerEndpoint endpoint = resolveMandatoryEndpoint(context(), "docker://info?clientProfile=#dockerProfile", DockerEndpoint.class);
+        assertNotNull(endpoint.getConfiguration().getClientProfile());
+        DockerClientProfile clientProfile =  endpoint.getConfiguration().getClientProfile();
+        assertEquals("192.168.59.103", clientProfile.getHost());
+        assertEquals((Integer) 2376, clientProfile.getPort());
+        assertTrue(clientProfile.isSecure());
+        assertEquals("/Users/cameluser/.boot2docker/certs/boot2docker-vm" ,clientProfile.getCertPath());
+
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AttachContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AttachContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AttachContainerCmdHeaderTest.java
index 472c409..a976001 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AttachContainerCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AttachContainerCmdHeaderTest.java
@@ -41,7 +41,7 @@ public class AttachContainerCmdHeaderTest extends BaseDockerHeaderTest<AttachCon
         String containerId = "9c09acd48a25";
         boolean stdOut = true;
         boolean stdErr = true;
-        boolean followStream = true;
+        boolean followStream = false;
         boolean logs = true;
         boolean timestamps = true;
         

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AuthCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AuthCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AuthCmdHeaderTest.java
index dc6c381..c3be8a4 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AuthCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/AuthCmdHeaderTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.docker.headers;
 import java.util.Map;
 
 import com.github.dockerjava.api.command.AuthCmd;
-
+import com.github.dockerjava.api.model.AuthConfig;
 import org.apache.camel.component.docker.DockerClientProfile;
 import org.apache.camel.component.docker.DockerConstants;
 import org.apache.camel.component.docker.DockerOperation;
@@ -56,6 +56,7 @@ public class AuthCmdHeaderTest extends BaseDockerHeaderTest<AuthCmd> {
         template.sendBodyAndHeaders("direct:in", "", headers);
         
         Mockito.verify(dockerClient, Mockito.times(1)).authCmd();
+        Mockito.verify(mockObject, Mockito.times(1)).withAuthConfig((AuthConfig)Mockito.anyObject());
         
     }
     

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BaseDockerHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BaseDockerHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BaseDockerHeaderTest.java
index ef547a7..2a86be7 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BaseDockerHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BaseDockerHeaderTest.java
@@ -93,6 +93,14 @@ public abstract class BaseDockerHeaderTest<T> extends CamelTestSupport {
         return "docker@camel.apache.org";
     }
     
+    protected Integer getMaxPerRouteConnections() {
+        return 100;
+    }
+
+    protected Integer getMaxTotalConnections() {
+        return 100;
+    }
+
     public T getMockObject() {
         return mockObject;
     }
@@ -102,6 +110,8 @@ public abstract class BaseDockerHeaderTest<T> extends CamelTestSupport {
         parameters.put(DockerConstants.DOCKER_HOST, getHost());
         parameters.put(DockerConstants.DOCKER_PORT, getPort());
         parameters.put(DockerConstants.DOCKER_EMAIL, getEmail());
+        parameters.put(DockerConstants.DOCKER_MAX_PER_ROUTE_CONNECTIONS, getMaxPerRouteConnections());
+        parameters.put(DockerConstants.DOCKER_MAX_TOTAL_CONNECTIONS, getMaxTotalConnections());
 
         return parameters;
     }
@@ -111,6 +121,8 @@ public abstract class BaseDockerHeaderTest<T> extends CamelTestSupport {
         clientProfile.setHost(getHost());
         clientProfile.setPort(getPort());
         clientProfile.setEmail(getEmail());
+        clientProfile.setMaxPerRouteConnections(getMaxPerRouteConnections());
+        clientProfile.setMaxTotalConnections(getMaxTotalConnections());
         
         return clientProfile;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BuildImageCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BuildImageCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BuildImageCmdHeaderTest.java
index d8ace61..4ee186a 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BuildImageCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/BuildImageCmdHeaderTest.java
@@ -56,9 +56,9 @@ public class BuildImageCmdHeaderTest extends BaseDockerHeaderTest<BuildImageCmd>
         template.sendBodyAndHeaders("direct:in", inputStream, getHeaders());
         
         Mockito.verify(dockerClient, Mockito.times(1)).buildImageCmd(Matchers.any(InputStream.class));
-        Mockito.verify(mockObject, Mockito.times(1)).withQuiet();
-        Mockito.verify(mockObject, Mockito.times(1)).withNoCache();
-        Mockito.verify(mockObject, Mockito.times(1)).withRemove();
+        Mockito.verify(mockObject, Mockito.times(1)).withQuiet(quiet);
+        Mockito.verify(mockObject, Mockito.times(1)).withNoCache(noCache);
+        Mockito.verify(mockObject, Mockito.times(1)).withRemove(remove);
         Mockito.verify(mockObject, Mockito.times(1)).withTag(tag);
         
     }
@@ -69,9 +69,9 @@ public class BuildImageCmdHeaderTest extends BaseDockerHeaderTest<BuildImageCmd>
         template.sendBodyAndHeaders("direct:in", file, getHeaders());
         
         Mockito.verify(dockerClient, Mockito.times(1)).buildImageCmd(Matchers.any(File.class));
-        Mockito.verify(mockObject, Mockito.times(1)).withQuiet();
-        Mockito.verify(mockObject, Mockito.times(1)).withNoCache();
-        Mockito.verify(mockObject, Mockito.times(1)).withRemove();
+        Mockito.verify(mockObject, Mockito.times(1)).withQuiet(quiet);
+        Mockito.verify(mockObject, Mockito.times(1)).withNoCache(noCache);
+        Mockito.verify(mockObject, Mockito.times(1)).withRemove(remove);
         Mockito.verify(mockObject, Mockito.times(1)).withTag(tag);
         
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CommitContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CommitContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CommitContainerCmdHeaderTest.java
new file mode 100644
index 0000000..83621cd
--- /dev/null
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CommitContainerCmdHeaderTest.java
@@ -0,0 +1,134 @@
+/**
+ * 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.docker.headers;
+
+import com.github.dockerjava.api.command.CommitCmd;
+import com.github.dockerjava.api.model.ExposedPort;
+import com.github.dockerjava.api.model.ExposedPorts;
+import com.github.dockerjava.api.model.Volume;
+import com.github.dockerjava.api.model.Volumes;
+
+import java.util.Map;
+
+import org.apache.camel.component.docker.DockerConstants;
+import org.apache.camel.component.docker.DockerOperation;
+import org.junit.Test;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+
+/**
+ * Validates Commit Container Request headers are parsed properly
+ */
+public class CommitContainerCmdHeaderTest extends BaseDockerHeaderTest<CommitCmd> {
+
+    
+    @Mock
+    private CommitCmd mockObject;
+    
+    @Test
+    public void commitContainerHeaderTest() {
+        
+        String containerId = "9c09acd48a25";
+        String env = "FOO=bar";
+        boolean attachStdErr = true;
+        boolean attachStdOut = true;
+        boolean attachStdIn = false;
+        boolean disableNetwork = false;
+        boolean openStdIn = false;
+        String portSpecs = "80";
+        boolean stdInOnce = false;
+        String tag = "1.0";
+        String repository = "docker/empty";
+        String cmd = "whoami";
+        String author = "cameluser";
+        String message = "Camel Docker Container Commit";
+        boolean pause = false;
+        ExposedPorts exposedPorts = new ExposedPorts(ExposedPort.tcp(22));
+        Integer memory = 2048;
+        Integer swapMemory = 512;
+        String workingDir = "/opt";
+        String user = "docker";
+        Volumes volumes = new Volumes(new Volume("/example"));
+        boolean tty = true;
+        String hostname = "dockerhostname";
+        
+        
+        Map<String, Object> headers = getDefaultParameters();
+        headers.put(DockerConstants.DOCKER_CONTAINER_ID, containerId);
+        headers.put(DockerConstants.DOCKER_ENV, env);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_IN, attachStdIn);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_ERR, attachStdErr);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_OUT, attachStdOut);
+        headers.put(DockerConstants.DOCKER_DISABLE_NETWORK, disableNetwork);
+        headers.put(DockerConstants.DOCKER_TAG, tag);
+        headers.put(DockerConstants.DOCKER_REPOSITORY, repository);
+        headers.put(DockerConstants.DOCKER_CMD, cmd);
+        headers.put(DockerConstants.DOCKER_AUTHOR, author);
+        headers.put(DockerConstants.DOCKER_MESSAGE, message);
+        headers.put(DockerConstants.DOCKER_PAUSE, pause);
+        headers.put(DockerConstants.DOCKER_EXPOSED_PORTS, exposedPorts);
+        headers.put(DockerConstants.DOCKER_MEMORY, memory);
+        headers.put(DockerConstants.DOCKER_MEMORY_SWAP, swapMemory);
+        headers.put(DockerConstants.DOCKER_WORKING_DIR, workingDir);
+        headers.put(DockerConstants.DOCKER_USER, user);
+        headers.put(DockerConstants.DOCKER_VOLUMES, volumes);
+        headers.put(DockerConstants.DOCKER_TTY, tty);
+        headers.put(DockerConstants.DOCKER_HOSTNAME, hostname);
+        headers.put(DockerConstants.DOCKER_OPEN_STD_IN, openStdIn);
+        headers.put(DockerConstants.DOCKER_STD_IN_ONCE, stdInOnce);
+        headers.put(DockerConstants.DOCKER_PORT_SPECS, portSpecs);
+        
+        template.sendBodyAndHeaders("direct:in", "", headers);
+        
+        Mockito.verify(dockerClient, Mockito.times(1)).commitCmd(containerId);
+        Mockito.verify(mockObject, Mockito.times(1)).withEnv(env);
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStderr(attachStdErr);
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStdin(attachStdIn);
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStdout(attachStdOut);
+        Mockito.verify(mockObject, Mockito.times(1)).withDisableNetwork(disableNetwork);
+        Mockito.verify(mockObject, Mockito.times(1)).withTag(tag);
+        Mockito.verify(mockObject, Mockito.times(1)).withRepository(repository);
+        Mockito.verify(mockObject, Mockito.times(1)).withCmd(cmd);
+        Mockito.verify(mockObject, Mockito.times(1)).withAuthor(author);
+        Mockito.verify(mockObject, Mockito.times(1)).withMessage(message);
+        Mockito.verify(mockObject, Mockito.times(1)).withPause(pause);
+        Mockito.verify(mockObject, Mockito.times(1)).withExposedPorts(exposedPorts);
+        Mockito.verify(mockObject, Mockito.times(1)).withMemory(memory);
+        Mockito.verify(mockObject, Mockito.times(1)).withMemorySwap(swapMemory);
+        Mockito.verify(mockObject, Mockito.times(1)).withWorkingDir(workingDir);
+        Mockito.verify(mockObject, Mockito.times(1)).withUser(user);
+        Mockito.verify(mockObject, Mockito.times(1)).withVolumes(volumes);
+        Mockito.verify(mockObject, Mockito.times(1)).withTty(tty);
+        Mockito.verify(mockObject, Mockito.times(1)).withHostname(hostname);
+        Mockito.verify(mockObject, Mockito.times(1)).withOpenStdin(openStdIn);
+        Mockito.verify(mockObject, Mockito.times(1)).withStdinOnce(stdInOnce);
+        Mockito.verify(mockObject, Mockito.times(1)).withPortSpecs(portSpecs);
+        
+    }
+
+    @Override
+    protected void setupMocks() {
+        Mockito.when(dockerClient.commitCmd(Matchers.anyString())).thenReturn(mockObject);
+    }
+
+    @Override
+    protected DockerOperation getOperation() {
+        return DockerOperation.COMMIT_CONTAINER;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CopyFileContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CopyFileContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CopyFileContainerCmdHeaderTest.java
index 195624e..1591e7a 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CopyFileContainerCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CopyFileContainerCmdHeaderTest.java
@@ -62,7 +62,7 @@ public class CopyFileContainerCmdHeaderTest extends BaseDockerHeaderTest<CopyFil
 
     @Override
     protected DockerOperation getOperation() {
-        return DockerOperation.CONTAINER_COPY_FILE;
+        return DockerOperation.COPY_FILE_CONTAINER;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateContainerCmdHeaderTest.java
index 986bf8f..1680143 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateContainerCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateContainerCmdHeaderTest.java
@@ -16,10 +16,13 @@
  */
 package org.apache.camel.component.docker.headers;
 
-import java.util.Map;
-
 import com.github.dockerjava.api.command.CreateContainerCmd;
+import com.github.dockerjava.api.model.Capability;
 import com.github.dockerjava.api.model.ExposedPort;
+import com.github.dockerjava.api.model.HostConfig;
+import com.github.dockerjava.api.model.Volume;
+
+import java.util.Map;
 
 import org.apache.camel.component.docker.DockerConstants;
 import org.apache.camel.component.docker.DockerOperation;
@@ -40,19 +43,91 @@ public class CreateContainerCmdHeaderTest extends BaseDockerHeaderTest<CreateCon
     @Test
     public void createContainerHeaderTest() {
         
-        String imageId = "be29975e0098";
-        ExposedPort tcp22 = ExposedPort.tcp(22);
+        String image = "busybox";
+        ExposedPort exposedPort = ExposedPort.tcp(22);
+        boolean tty = true;
+        String name = "cameldocker";
+        String workingDir = "/opt";
+        boolean disableNetwork = false;
+        String hostname = "dockerjava";
+        String user = "docker";
+        boolean stdInOpen = false;
+        boolean stdInOnce = false;
+        boolean attachStdErr = true;
+        boolean attachStdOut = true;
+        boolean attachStdIn = false;
+        Long memoryLimit = 2048L;
+        Long swapMemory = 512L;
+        Integer cpuShares = 512;
+        Volume volumes = new Volume("/example");
+        String volumesFromContainer = "container2";
+        String env = "FOO=bar";
+        String cmd = "whoami";
+        HostConfig hostConfig = new HostConfig();
+        Capability capAdd = Capability.NET_BROADCAST;
+        Capability capDrop = Capability.BLOCK_SUSPEND;
+        String[] entrypoint = new String[]{"sleep","9999"};
+        String portSpecs = "80";
+        String dns = "8.8.8.8";
 
         
         Map<String, Object> headers = getDefaultParameters();
-        headers.put(DockerConstants.DOCKER_IMAGE_ID, imageId);
-        headers.put(DockerConstants.DOCKER_EXPOSED_PORTS, tcp22);
+        headers.put(DockerConstants.DOCKER_IMAGE, image);
+        headers.put(DockerConstants.DOCKER_EXPOSED_PORTS, exposedPort);
+        headers.put(DockerConstants.DOCKER_TTY, tty);
+        headers.put(DockerConstants.DOCKER_NAME, name);
+        headers.put(DockerConstants.DOCKER_WORKING_DIR, workingDir);
+        headers.put(DockerConstants.DOCKER_DISABLE_NETWORK, disableNetwork);
+        headers.put(DockerConstants.DOCKER_HOSTNAME, hostname);
+        headers.put(DockerConstants.DOCKER_USER, user);
+        headers.put(DockerConstants.DOCKER_STD_IN_OPEN, stdInOpen);
+        headers.put(DockerConstants.DOCKER_STD_IN_ONCE, stdInOnce);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_IN, attachStdIn);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_ERR, attachStdErr);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_OUT, attachStdOut);
+        headers.put(DockerConstants.DOCKER_MEMORY_LIMIT, memoryLimit);
+        headers.put(DockerConstants.DOCKER_MEMORY_SWAP, swapMemory);
+        headers.put(DockerConstants.DOCKER_CPU_SHARES, cpuShares);
+        headers.put(DockerConstants.DOCKER_VOLUMES, volumes);
+        headers.put(DockerConstants.DOCKER_VOLUMES_FROM, volumesFromContainer);
+        headers.put(DockerConstants.DOCKER_ENV, env);
+        headers.put(DockerConstants.DOCKER_CMD, cmd);
+        headers.put(DockerConstants.DOCKER_HOST_CONFIG, hostConfig);
+        headers.put(DockerConstants.DOCKER_CAP_ADD, capAdd);
+        headers.put(DockerConstants.DOCKER_CAP_DROP, capDrop);
+        headers.put(DockerConstants.DOCKER_ENTRYPOINT, entrypoint);
+        headers.put(DockerConstants.DOCKER_PORT_SPECS, portSpecs);
+        headers.put(DockerConstants.DOCKER_DNS, dns);
 
         
         template.sendBodyAndHeaders("direct:in", "", headers);
         
-        Mockito.verify(dockerClient, Mockito.times(1)).createContainerCmd(imageId);
-        Mockito.verify(mockObject, Mockito.times(1)).withExposedPorts(Matchers.any(ExposedPort.class));
+        Mockito.verify(dockerClient, Mockito.times(1)).createContainerCmd(image);
+        Mockito.verify(mockObject, Mockito.times(1)).withExposedPorts(Matchers.eq(exposedPort));
+        Mockito.verify(mockObject, Mockito.times(1)).withTty(Matchers.eq(tty));
+        Mockito.verify(mockObject, Mockito.times(1)).withName(Matchers.eq(name));
+        Mockito.verify(mockObject, Mockito.times(1)).withWorkingDir(workingDir);
+        Mockito.verify(mockObject, Mockito.times(1)).withDisableNetwork(disableNetwork);
+        Mockito.verify(mockObject, Mockito.times(1)).withHostName(hostname);
+        Mockito.verify(mockObject, Mockito.times(1)).withUser(user);
+        Mockito.verify(mockObject, Mockito.times(1)).withStdinOpen(stdInOpen);
+        Mockito.verify(mockObject, Mockito.times(1)).withStdInOnce(stdInOnce);
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStderr(attachStdErr);
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStdin(attachStdIn);
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStdout(attachStdOut);
+        Mockito.verify(mockObject, Mockito.times(1)).withMemoryLimit(memoryLimit);
+        Mockito.verify(mockObject, Mockito.times(1)).withMemorySwap(swapMemory);
+        Mockito.verify(mockObject, Mockito.times(1)).withCpuShares(cpuShares);
+        Mockito.verify(mockObject, Mockito.times(1)).withVolumes(volumes);
+        Mockito.verify(mockObject, Mockito.times(1)).withVolumesFrom(volumesFromContainer);
+        Mockito.verify(mockObject, Mockito.times(1)).withEnv(env);
+        Mockito.verify(mockObject, Mockito.times(1)).withCmd(cmd);
+        Mockito.verify(mockObject, Mockito.times(1)).withHostConfig(hostConfig);
+        Mockito.verify(mockObject, Mockito.times(1)).withCapAdd(capAdd);
+        Mockito.verify(mockObject, Mockito.times(1)).withCapDrop(capDrop);
+        Mockito.verify(mockObject, Mockito.times(1)).withEntrypoint(entrypoint);
+        Mockito.verify(mockObject, Mockito.times(1)).withPortSpecs(portSpecs);
+        Mockito.verify(mockObject, Mockito.times(1)).withDns(dns);
         
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateImageCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateImageCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateImageCmdHeaderTest.java
index cf5c3bd..464a2ca 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateImageCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/CreateImageCmdHeaderTest.java
@@ -16,11 +16,11 @@
  */
 package org.apache.camel.component.docker.headers;
 
+import com.github.dockerjava.api.command.CreateImageCmd;
+
 import java.io.InputStream;
 import java.util.Map;
 
-import com.github.dockerjava.api.command.CreateImageCmd;
-
 import org.apache.camel.component.docker.DockerConstants;
 import org.apache.camel.component.docker.DockerOperation;
 import org.junit.Test;
@@ -36,6 +36,9 @@ public class CreateImageCmdHeaderTest extends BaseDockerHeaderTest<CreateImageCm
     @Mock
     private CreateImageCmd mockObject;
     
+    @Mock
+    private InputStream inputStream;
+
     @Test
     public void createImageHeaderTest() {
         
@@ -44,12 +47,10 @@ public class CreateImageCmdHeaderTest extends BaseDockerHeaderTest<CreateImageCm
         Map<String, Object> headers = getDefaultParameters();
         headers.put(DockerConstants.DOCKER_REPOSITORY, repository);
         
-        template.sendBodyAndHeaders("direct:in", "", headers);
+        template.sendBodyAndHeaders("direct:in", inputStream, headers);
         
         Mockito.verify(dockerClient, Mockito.times(1)).createImageCmd(Matchers.eq(repository), Matchers.any(InputStream.class));
         
-
-        
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/DiffContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/DiffContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/DiffContainerCmdHeaderTest.java
index e0c3808..9e65897 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/DiffContainerCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/DiffContainerCmdHeaderTest.java
@@ -39,13 +39,16 @@ public class DiffContainerCmdHeaderTest extends BaseDockerHeaderTest<ContainerDi
     public void containerDiffHeaderTest() {
                 
         String containerId = "9c09acd48a25";
+        String containerIdDiff = "0f9dfe8defa0";
         
         Map<String, Object> headers = getDefaultParameters();
         headers.put(DockerConstants.DOCKER_CONTAINER_ID, containerId);
+        headers.put(DockerConstants.DOCKER_CONTAINER_ID_DIFF, containerIdDiff);
         
         template.sendBodyAndHeaders("direct:in", "", headers);
         
         Mockito.verify(dockerClient, Mockito.times(1)).containerDiffCmd(containerId);
+        Mockito.verify(mockObject, Mockito.times(1)).withContainerId(containerIdDiff);
         
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecCreateCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecCreateCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecCreateCmdHeaderTest.java
new file mode 100644
index 0000000..12925df
--- /dev/null
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecCreateCmdHeaderTest.java
@@ -0,0 +1,80 @@
+/**
+ * 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.docker.headers;
+
+import com.github.dockerjava.api.command.ExecCreateCmd;
+
+import java.util.Map;
+
+import org.apache.camel.component.docker.DockerConstants;
+import org.apache.camel.component.docker.DockerOperation;
+import org.junit.Test;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+
+/**
+ * Validates Exec Create Request headers are parsed properly
+ */
+public class ExecCreateCmdHeaderTest extends BaseDockerHeaderTest<ExecCreateCmd> {
+    
+    @Mock
+    private ExecCreateCmd mockObject;
+    
+    @Test
+    public void execCreateHeaderTest() {
+        
+        String containerId = "9c09acd48a25";
+        boolean tty = true;
+        boolean stdErr = false;
+        boolean stdOut = true;
+        boolean stdIn = true;
+        
+        
+        Map<String, Object> headers = getDefaultParameters();
+        headers.put(DockerConstants.DOCKER_CONTAINER_ID, containerId);
+        headers.put(DockerConstants.DOCKER_TTY, tty);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_ERR, stdErr);        
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_OUT, stdOut);
+        headers.put(DockerConstants.DOCKER_ATTACH_STD_IN, stdIn);
+        headers.put(DockerConstants.DOCKER_CMD, "date;whoami");
+
+
+        template.sendBodyAndHeaders("direct:in", "", headers);
+        
+        Mockito.verify(dockerClient, Mockito.times(1)).execCreateCmd(Matchers.eq(containerId));
+        Mockito.verify(mockObject, Mockito.times(1)).withTty(Matchers.eq(tty));
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStderr(Matchers.eq(stdErr));
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStdout(Matchers.eq(stdOut));
+        Mockito.verify(mockObject, Mockito.times(1)).withAttachStdin(Matchers.eq(stdIn));
+        Mockito.verify(mockObject, Mockito.times(1)).withCmd(new String[]{"date","whoami"});
+
+
+        
+    }
+    
+    @Override
+    protected void setupMocks() {
+        Mockito.when(dockerClient.execCreateCmd(Matchers.anyString())).thenReturn(mockObject);
+    }
+
+    @Override
+    protected DockerOperation getOperation() {
+        return DockerOperation.EXEC_CREATE;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecStartCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecStartCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecStartCmdHeaderTest.java
new file mode 100644
index 0000000..6498b22
--- /dev/null
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ExecStartCmdHeaderTest.java
@@ -0,0 +1,65 @@
+/**
+ * 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.docker.headers;
+
+import com.github.dockerjava.api.command.ExecStartCmd;
+
+import java.util.Map;
+
+import org.apache.camel.component.docker.DockerConstants;
+import org.apache.camel.component.docker.DockerOperation;
+import org.junit.Test;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+
+/**
+ * Validates Exec Start Request headers are parsed properly
+ */
+public class ExecStartCmdHeaderTest extends BaseDockerHeaderTest<ExecStartCmd> {
+    
+    @Mock
+    private ExecStartCmd mockObject;
+    
+    @Test
+    public void execCreateHeaderTest() {
+        
+        String id = "1";
+        boolean tty = true;
+        
+        Map<String, Object> headers = getDefaultParameters();
+        headers.put(DockerConstants.DOCKER_EXEC_ID, id);
+        headers.put(DockerConstants.DOCKER_TTY, tty);
+        
+        template.sendBodyAndHeaders("direct:in", "", headers);
+        
+        Mockito.verify(dockerClient, Mockito.times(1)).execStartCmd(Matchers.eq(id));
+        Mockito.verify(mockObject, Mockito.times(1)).withTty(Matchers.eq(tty));
+        
+    }
+    
+    @Override
+    protected void setupMocks() {
+        Mockito.when(dockerClient.execStartCmd(Matchers.anyString())).thenReturn(mockObject);
+    }
+
+    @Override
+    protected DockerOperation getOperation() {
+        return DockerOperation.EXEC_START;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InfoCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InfoCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InfoCmdHeaderTest.java
index 0940e87..85af45d 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InfoCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InfoCmdHeaderTest.java
@@ -34,7 +34,7 @@ public class InfoCmdHeaderTest extends BaseDockerHeaderTest<InfoCmd> {
     private InfoCmd mockObject;
     
     @Test
-    public void listImageHeaderTest() {
+    public void infoHeaderTest() {
                 
         Map<String, Object> headers = getDefaultParameters();
         

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InspectImageCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InspectImageCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InspectImageCmdHeaderTest.java
index 5a17d10..a315fc4 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InspectImageCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/InspectImageCmdHeaderTest.java
@@ -42,7 +42,6 @@ public class InspectImageCmdHeaderTest extends BaseDockerHeaderTest<InspectImage
         
         Map<String, Object> headers = getDefaultParameters();
         headers.put(DockerConstants.DOCKER_IMAGE_ID, imageId);
-
         
         template.sendBodyAndHeaders("direct:in", "", headers);
         

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/KillContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/KillContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/KillContainerCmdHeaderTest.java
index 3eea885..28a3012 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/KillContainerCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/KillContainerCmdHeaderTest.java
@@ -45,7 +45,6 @@ public class KillContainerCmdHeaderTest extends BaseDockerHeaderTest<KillContain
         headers.put(DockerConstants.DOCKER_CONTAINER_ID, containerId);
         headers.put(DockerConstants.DOCKER_SIGNAL, signal);
 
-        
         template.sendBodyAndHeaders("direct:in", "", headers);
                 
         Mockito.verify(dockerClient, Mockito.times(1)).killContainerCmd(containerId);

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListContainersCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListContainersCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListContainersCmdHeaderTest.java
index 1dae882..35a377d 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListContainersCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListContainersCmdHeaderTest.java
@@ -39,13 +39,17 @@ public class ListContainersCmdHeaderTest extends BaseDockerHeaderTest<ListContai
     public void listContainerHeaderTest() {
         
         boolean showSize = true;
-        boolean showAll = true;
+        boolean showAll = false;
         int limit = 2;
+        String since = "id1";
+        String before = "id2";
         
         Map<String, Object> headers = getDefaultParameters();
         headers.put(DockerConstants.DOCKER_LIMIT, limit);
         headers.put(DockerConstants.DOCKER_SHOW_ALL, showAll);
         headers.put(DockerConstants.DOCKER_SHOW_SIZE, showSize);
+        headers.put(DockerConstants.DOCKER_SINCE, since);
+        headers.put(DockerConstants.DOCKER_BEFORE, before);
 
 
         
@@ -55,7 +59,8 @@ public class ListContainersCmdHeaderTest extends BaseDockerHeaderTest<ListContai
         Mockito.verify(mockObject, Mockito.times(1)).withShowAll(Matchers.eq(showAll));
         Mockito.verify(mockObject, Mockito.times(1)).withShowSize(Matchers.eq(showSize));
         Mockito.verify(mockObject, Mockito.times(1)).withLimit(Matchers.eq(limit));
-
+        Mockito.verify(mockObject, Mockito.times(1)).withSince(Matchers.eq(since));
+        Mockito.verify(mockObject, Mockito.times(1)).withBefore(Matchers.eq(before));
         
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
index ad4a03b..b2e6a91 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
@@ -39,7 +39,7 @@ public class ListImagesCmdHeaderTest extends BaseDockerHeaderTest<ListImagesCmd>
     @Test
     public void listImageHeaderTest() {
         
-        String filter = "filter";
+        String filter = "{\"dangling\":[\"true\"]}";
         Boolean showAll = true;
         
         Map<String, Object> headers = getDefaultParameters();

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/LogContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/LogContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/LogContainerCmdHeaderTest.java
index b509677..e427b35 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/LogContainerCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/LogContainerCmdHeaderTest.java
@@ -42,7 +42,7 @@ public class LogContainerCmdHeaderTest extends BaseDockerHeaderTest<LogContainer
         boolean stdOut = true;
         boolean stdErr = true;
         boolean followStream = true;
-        boolean timestamps = true;
+        boolean timestamps = false;
         boolean tailAll = true;
         int tail = 5;
         

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/PushImageCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/PushImageCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/PushImageCmdHeaderTest.java
index 95895c8..59091f1 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/PushImageCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/PushImageCmdHeaderTest.java
@@ -41,6 +41,7 @@ public class PushImageCmdHeaderTest extends BaseDockerHeaderTest<PushImageCmd> {
     private String email = "jdoe@example.com";
     private String serverAddress = "http://docker.io/v1";
     private String name = "imagename";
+    private String tag = "1.0";
 
     
     @Test
@@ -53,11 +54,14 @@ public class PushImageCmdHeaderTest extends BaseDockerHeaderTest<PushImageCmd> {
         headers.put(DockerConstants.DOCKER_EMAIL, email);
         headers.put(DockerConstants.DOCKER_SERVER_ADDRESS, serverAddress);
         headers.put(DockerConstants.DOCKER_NAME, name);
+        headers.put(DockerConstants.DOCKER_TAG, tag);
 
         
         template.sendBodyAndHeaders("direct:in", "", headers);
         
         Mockito.verify(dockerClient, Mockito.times(1)).pushImageCmd(name);
+        Mockito.verify(mockObject, Mockito.times(1)).withTag(tag);
+
         
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/RemoveContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/RemoveContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/RemoveContainerCmdHeaderTest.java
index 6e7c387..ff434da 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/RemoveContainerCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/RemoveContainerCmdHeaderTest.java
@@ -39,7 +39,7 @@ public class RemoveContainerCmdHeaderTest extends BaseDockerHeaderTest<RemoveCon
     public void removeContainerHeaderTest() {
         
         String containerId = "9c09acd48a25";
-        boolean force = true;
+        boolean force = false;
         boolean removeVolumes = true;
         
         Map<String, Object> headers = getDefaultParameters();

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/StartContainerCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/StartContainerCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/StartContainerCmdHeaderTest.java
new file mode 100644
index 0000000..e3e266f
--- /dev/null
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/StartContainerCmdHeaderTest.java
@@ -0,0 +1,121 @@
+/**
+ * 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.docker.headers;
+
+import com.github.dockerjava.api.command.StartContainerCmd;
+import com.github.dockerjava.api.model.Bind;
+import com.github.dockerjava.api.model.Capability;
+import com.github.dockerjava.api.model.Device;
+import com.github.dockerjava.api.model.ExposedPort;
+import com.github.dockerjava.api.model.Link;
+import com.github.dockerjava.api.model.LxcConf;
+import com.github.dockerjava.api.model.PortBinding;
+import com.github.dockerjava.api.model.Ports;
+import com.github.dockerjava.api.model.RestartPolicy;
+import com.github.dockerjava.api.model.Volume;
+
+import java.util.Map;
+
+import org.apache.camel.component.docker.DockerConstants;
+import org.apache.camel.component.docker.DockerOperation;
+import org.junit.Test;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+
+/**
+ * Validates Start Container Request headers are applied properly
+ */
+public class StartContainerCmdHeaderTest extends BaseDockerHeaderTest<StartContainerCmd> {
+    
+    @Mock
+    private StartContainerCmd mockObject;
+    
+    @Mock
+    ExposedPort exposedPort;
+    
+    @Test
+    public void startContainerHeaderTest() {
+        
+        String containerId = "be29975e0098";
+        Volume vol = new Volume("/opt/webapp1");
+        Bind[] binds = new Bind[]{new Bind("/opt/webapp1",vol)};
+        boolean publishAllPorts = false;
+        boolean privileged = false;
+        String[] dns = new String[]{"8.8.8.8"};
+        Link[] links = new Link[]{new Link("container1", "container1Link")};
+        String networkMode = "host";
+        LxcConf[] lxcConf = new LxcConf[]{new LxcConf()};
+        String volumesFromContainer = "container2";
+        Capability capAdd = Capability.NET_BROADCAST;
+        Capability capDrop = Capability.BLOCK_SUSPEND;
+        Device[] devices = new Device[]{new Device("rwm", "/dev/nulo", "/dev/zero")};
+        RestartPolicy restartPolicy = RestartPolicy.noRestart();
+        PortBinding[] portBindings = new PortBinding[]{new PortBinding(Ports.Binding(28768),ExposedPort.tcp(22))};
+        Ports ports = new Ports(ExposedPort.tcp(22), Ports.Binding(11022));
+        
+        Map<String, Object> headers = getDefaultParameters();
+        headers.put(DockerConstants.DOCKER_CONTAINER_ID, containerId);
+        headers.put(DockerConstants.DOCKER_BINDS, binds);
+        headers.put(DockerConstants.DOCKER_PUBLISH_ALL_PORTS, publishAllPorts);
+        headers.put(DockerConstants.DOCKER_PRIVILEGED, privileged);
+        headers.put(DockerConstants.DOCKER_DNS, dns);
+        headers.put(DockerConstants.DOCKER_DNS_SEARCH, dns);
+        headers.put(DockerConstants.DOCKER_LINKS, links);
+        headers.put(DockerConstants.DOCKER_NETWORK_MODE, networkMode);
+        headers.put(DockerConstants.DOCKER_LXC_CONF, lxcConf);
+        headers.put(DockerConstants.DOCKER_VOLUMES_FROM, volumesFromContainer);
+        headers.put(DockerConstants.DOCKER_CAP_ADD, capAdd);
+        headers.put(DockerConstants.DOCKER_CAP_DROP, capDrop);
+        headers.put(DockerConstants.DOCKER_DEVICES, devices);
+        headers.put(DockerConstants.DOCKER_RESTART_POLICY, restartPolicy);
+        headers.put(DockerConstants.DOCKER_PORT_BINDINGS, portBindings);
+        headers.put(DockerConstants.DOCKER_PORTS, ports);
+
+        
+        template.sendBodyAndHeaders("direct:in", "", headers);
+                
+        Mockito.verify(dockerClient, Mockito.times(1)).startContainerCmd(containerId);
+        Mockito.verify(mockObject, Mockito.times(1)).withBinds(binds);
+        Mockito.verify(mockObject, Mockito.times(1)).withPublishAllPorts(publishAllPorts);
+        Mockito.verify(mockObject, Mockito.times(1)).withPrivileged(privileged);
+        Mockito.verify(mockObject, Mockito.times(1)).withDns(dns);
+        Mockito.verify(mockObject, Mockito.times(1)).withDnsSearch(dns);
+        Mockito.verify(mockObject, Mockito.times(1)).withLinks(links);
+        Mockito.verify(mockObject, Mockito.times(1)).withNetworkMode(networkMode);
+        Mockito.verify(mockObject, Mockito.times(1)).withLxcConf(lxcConf);
+        Mockito.verify(mockObject, Mockito.times(1)).withVolumesFrom(volumesFromContainer);
+        Mockito.verify(mockObject, Mockito.times(1)).withCapAdd(capAdd);
+        Mockito.verify(mockObject, Mockito.times(1)).withCapDrop(capDrop);
+        Mockito.verify(mockObject, Mockito.times(1)).withDevices(devices);
+        Mockito.verify(mockObject, Mockito.times(1)).withRestartPolicy(restartPolicy);
+        Mockito.verify(mockObject, Mockito.times(1)).withPortBindings(portBindings);
+        Mockito.verify(mockObject, Mockito.times(1)).withPortBindings(ports);
+        
+    }
+
+    @Override
+    protected void setupMocks() {
+        Mockito.when(dockerClient.startContainerCmd(Matchers.anyString())).thenReturn(mockObject);
+    }
+
+    @Override
+    protected DockerOperation getOperation() {
+        return DockerOperation.START_CONTAINER;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/fb9556df/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/TagImageCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/TagImageCmdHeaderTest.java b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/TagImageCmdHeaderTest.java
index cbb3f0f..577b6a0 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/TagImageCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/TagImageCmdHeaderTest.java
@@ -36,7 +36,7 @@ public class TagImageCmdHeaderTest extends BaseDockerHeaderTest<TagImageCmd> {
     private TagImageCmd mockObject;
     
     @Test
-    public void topImageHeaderTest() {
+    public void tagImageHeaderTest() {
         
         String imageId = "be29975e0098";
         String repository = "docker/empty";
@@ -54,7 +54,7 @@ public class TagImageCmdHeaderTest extends BaseDockerHeaderTest<TagImageCmd> {
         template.sendBodyAndHeaders("direct:in", "", headers);
                 
         Mockito.verify(dockerClient, Mockito.times(1)).tagImageCmd(imageId, repository, tag);
-        Mockito.verify(mockObject, Mockito.times(1)).withForce();
+        Mockito.verify(mockObject, Mockito.times(1)).withForce(force);
         
     }
 


Mime
View raw message