camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [05/12] camel git commit: CAMEL-11356: Camel-Kubernetes: refactoring tests by using Kubernetes-server-mock and Openshift-server-mock - Builds tests
Date Tue, 30 May 2017 09:04:54 GMT
CAMEL-11356: Camel-Kubernetes: refactoring tests by using Kubernetes-server-mock and Openshift-server-mock
- Builds tests


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cbbfcf88
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cbbfcf88
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cbbfcf88

Branch: refs/heads/master
Commit: cbbfcf8835bfba8e650e62e04ea218ca8bb76c5e
Parents: 78432c1
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Mon May 29 13:50:21 2017 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Tue May 30 11:01:10 2017 +0200

----------------------------------------------------------------------
 components/camel-kubernetes/pom.xml             |  6 +++
 .../kubernetes-build-configs-component.adoc     |  2 +-
 .../main/docs/kubernetes-builds-component.adoc  |  2 +-
 .../src/main/docs/kubernetes-component.adoc     |  4 +-
 .../docs/kubernetes-config-maps-component.adoc  |  2 +-
 .../docs/kubernetes-namespaces-component.adoc   |  2 +-
 .../main/docs/kubernetes-nodes-component.adoc   |  2 +-
 ...tes-persistent-volumes-claims-component.adoc |  2 +-
 ...kubernetes-persistent-volumes-component.adoc |  2 +-
 .../main/docs/kubernetes-pods-component.adoc    |  2 +-
 ...netes-replication-controllers-component.adoc |  2 +-
 .../kubernetes-resources-quota-component.adoc   |  2 +-
 .../main/docs/kubernetes-secrets-component.adoc |  2 +-
 .../docs/kubernetes-services-component.adoc     |  2 +-
 .../kubernetes/KubernetesConfiguration.java     |  7 +--
 .../builds/KubernetesBuildsProducer.java        | 26 +++++----
 .../DeprecatedKubernetesBuildsProducerTest.java |  2 +
 .../producer/KubernetesBuildsProducerTest.java  | 56 +++++++++++---------
 18 files changed, 68 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/pom.xml b/components/camel-kubernetes/pom.xml
index 9acff98..e5409c8 100644
--- a/components/camel-kubernetes/pom.xml
+++ b/components/camel-kubernetes/pom.xml
@@ -59,6 +59,12 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>io.fabric8</groupId>
+      <artifactId>openshift-server-mock</artifactId>
+      <version>${kubernetes-client-version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-test-spring</artifactId>
       <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-build-configs-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-build-configs-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-build-configs-component.adoc
index 283adbc..d0029aa 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-build-configs-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-build-configs-component.adoc
@@ -37,7 +37,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (producer) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (producer) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **operation** (producer) | Producer operation to do on Kubernetes |  | String
 | **portName** (producer) | The port name used for ServiceCall EIP |  | String
 | **synchronous** (advanced) | Sets whether synchronous processing should be strictly used
or Camel is allowed to use asynchronous processing (if supported). | false | boolean

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-builds-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-builds-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-builds-component.adoc
index e8f97e3..61714a7 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-builds-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-builds-component.adoc
@@ -37,7 +37,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (producer) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (producer) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **operation** (producer) | Producer operation to do on Kubernetes |  | String
 | **portName** (producer) | The port name used for ServiceCall EIP |  | String
 | **synchronous** (advanced) | Sets whether synchronous processing should be strictly used
or Camel is allowed to use asynchronous processing (if supported). | false | boolean

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-component.adoc
index 946ed99..8c6551b 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-component.adoc
@@ -86,7 +86,7 @@ with the following path and query parameters:
 | **apiVersion** (common) | The Kubernetes API Version to use |  | String
 | **category** (common) | *Required* Kubernetes Producer and Consumer category |  | String
 | **dnsDomain** (common) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **portName** (common) | The port name used for ServiceCall EIP |  | String
 | **bridgeErrorHandler** (consumer) | Allows for bridging the consumer to the Camel routing
Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming
messages or the likes will now be processed as a message and handled by the routing Error
Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
with exceptions that will be logged at WARN or ERROR level and ignored. | false | boolean
 | **labelKey** (consumer) | The Consumer Label key when watching at some resources |  | String
@@ -248,4 +248,4 @@ from("direct:createPod")
     .toF("kubernetes://%s?oauthToken=%s&category=pods&operation=deletePod", host,
authToken);
 -------------------------------------------------------------
 
-By using the KubernetesConstants.KUBERNETES_POD_NAME header you can specify your Pod name
and pass it to this operation.
\ No newline at end of file
+By using the KubernetesConstants.KUBERNETES_POD_NAME header you can specify your Pod name
and pass it to this operation.

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc
index bbf2b9b..f1feefa 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc
@@ -37,7 +37,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (producer) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (producer) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **operation** (producer) | Producer operation to do on Kubernetes |  | String
 | **portName** (producer) | The port name used for ServiceCall EIP |  | String
 | **synchronous** (advanced) | Sets whether synchronous processing should be strictly used
or Camel is allowed to use asynchronous processing (if supported). | false | boolean

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-namespaces-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-namespaces-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-namespaces-component.adoc
index a84c873..8c2546f 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-namespaces-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-namespaces-component.adoc
@@ -39,7 +39,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (common) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (common) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **portName** (common) | The port name used for ServiceCall EIP |  | String
 | **bridgeErrorHandler** (consumer) | Allows for bridging the consumer to the Camel routing
Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming
messages or the likes will now be processed as a message and handled by the routing Error
Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
with exceptions that will be logged at WARN or ERROR level and ignored. | false | boolean
 | **labelKey** (consumer) | The Consumer Label key when watching at some resources |  | String

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc
index dc7419e..0e76719 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc
@@ -39,7 +39,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (common) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (common) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **portName** (common) | The port name used for ServiceCall EIP |  | String
 | **bridgeErrorHandler** (consumer) | Allows for bridging the consumer to the Camel routing
Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming
messages or the likes will now be processed as a message and handled by the routing Error
Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
with exceptions that will be logged at WARN or ERROR level and ignored. | false | boolean
 | **labelKey** (consumer) | The Consumer Label key when watching at some resources |  | String

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
index d4af93d..cc3f73c 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
@@ -38,7 +38,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (producer) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (producer) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **operation** (producer) | Producer operation to do on Kubernetes |  | String
 | **portName** (producer) | The port name used for ServiceCall EIP |  | String
 | **synchronous** (advanced) | Sets whether synchronous processing should be strictly used
or Camel is allowed to use asynchronous processing (if supported). | false | boolean

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
index ad77b52..e60f116 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
@@ -38,7 +38,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (producer) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (producer) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **operation** (producer) | Producer operation to do on Kubernetes |  | String
 | **portName** (producer) | The port name used for ServiceCall EIP |  | String
 | **synchronous** (advanced) | Sets whether synchronous processing should be strictly used
or Camel is allowed to use asynchronous processing (if supported). | false | boolean

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc
index 09e76fc..45d3407 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc
@@ -38,7 +38,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (common) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (common) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **portName** (common) | The port name used for ServiceCall EIP |  | String
 | **bridgeErrorHandler** (consumer) | Allows for bridging the consumer to the Camel routing
Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming
messages or the likes will now be processed as a message and handled by the routing Error
Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
with exceptions that will be logged at WARN or ERROR level and ignored. | false | boolean
 | **labelKey** (consumer) | The Consumer Label key when watching at some resources |  | String

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-replication-controllers-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-replication-controllers-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-replication-controllers-component.adoc
index 0854d6b..937f49a 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-replication-controllers-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-replication-controllers-component.adoc
@@ -39,7 +39,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (common) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (common) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **portName** (common) | The port name used for ServiceCall EIP |  | String
 | **bridgeErrorHandler** (consumer) | Allows for bridging the consumer to the Camel routing
Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming
messages or the likes will now be processed as a message and handled by the routing Error
Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
with exceptions that will be logged at WARN or ERROR level and ignored. | false | boolean
 | **labelKey** (consumer) | The Consumer Label key when watching at some resources |  | String

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-resources-quota-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-resources-quota-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-resources-quota-component.adoc
index 06a16e5..c89027e 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-resources-quota-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-resources-quota-component.adoc
@@ -38,7 +38,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (producer) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (producer) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **operation** (producer) | Producer operation to do on Kubernetes |  | String
 | **portName** (producer) | The port name used for ServiceCall EIP |  | String
 | **synchronous** (advanced) | Sets whether synchronous processing should be strictly used
or Camel is allowed to use asynchronous processing (if supported). | false | boolean

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-secrets-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-secrets-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-secrets-component.adoc
index a1e819b..7e0dc79 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-secrets-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-secrets-component.adoc
@@ -38,7 +38,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (producer) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (producer) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (producer) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **operation** (producer) | Producer operation to do on Kubernetes |  | String
 | **portName** (producer) | The port name used for ServiceCall EIP |  | String
 | **synchronous** (advanced) | Sets whether synchronous processing should be strictly used
or Camel is allowed to use asynchronous processing (if supported). | false | boolean

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/docs/kubernetes-services-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-services-component.adoc
b/components/camel-kubernetes/src/main/docs/kubernetes-services-component.adoc
index e77e469..8970059 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-services-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-services-component.adoc
@@ -39,7 +39,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **apiVersion** (common) | The Kubernetes API Version to use |  | String
 | **dnsDomain** (common) | The dns domain used for ServiceCall EIP |  | String
-| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | DefaultKubernetesClient
+| **kubernetesClient** (common) | Default KubernetesClient to use if provided |  | KubernetesClient
 | **portName** (common) | The port name used for ServiceCall EIP |  | String
 | **bridgeErrorHandler** (consumer) | Allows for bridging the consumer to the Camel routing
Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming
messages or the likes will now be processed as a message and handled by the routing Error
Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
with exceptions that will be logged at WARN or ERROR level and ignored. | false | boolean
 | **labelKey** (consumer) | The Consumer Label key when watching at some resources |  | String

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesConfiguration.java
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesConfiguration.java
index b31af49..89d0d9a 100644
--- a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesConfiguration.java
+++ b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesConfiguration.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.kubernetes;
 
 import io.fabric8.kubernetes.client.DefaultKubernetesClient;
+import io.fabric8.kubernetes.client.KubernetesClient;
 
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
@@ -34,7 +35,7 @@ public class KubernetesConfiguration {
     private String category;
 
     @UriParam
-    private DefaultKubernetesClient kubernetesClient;
+    private KubernetesClient kubernetesClient;
 
     @UriParam(label = "security", secret = true)
     private String username;
@@ -138,11 +139,11 @@ public class KubernetesConfiguration {
     /**
      * Default KubernetesClient to use if provided
      */
-    public DefaultKubernetesClient getKubernetesClient() {
+    public KubernetesClient getKubernetesClient() {
         return kubernetesClient;
     }
 
-    public void setKubernetesClient(DefaultKubernetesClient kubernetesClient) {
+    public void setKubernetesClient(KubernetesClient kubernetesClient) {
         this.kubernetesClient = kubernetesClient;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/builds/KubernetesBuildsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/builds/KubernetesBuildsProducer.java
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/builds/KubernetesBuildsProducer.java
index e44b6f2..44d2634 100644
--- a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/builds/KubernetesBuildsProducer.java
+++ b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/builds/KubernetesBuildsProducer.java
@@ -18,8 +18,10 @@ package org.apache.camel.component.kubernetes.builds;
 
 import java.util.Map;
 
+import io.fabric8.kubernetes.client.Watch;
+import io.fabric8.kubernetes.client.Watcher;
+import io.fabric8.kubernetes.client.dsl.FilterWatchListMultiDeletable;
 import io.fabric8.kubernetes.client.dsl.LogWatch;
-import io.fabric8.kubernetes.client.dsl.MixedOperation;
 import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation;
 import io.fabric8.openshift.api.model.Build;
 import io.fabric8.openshift.api.model.BuildList;
@@ -30,7 +32,6 @@ import io.fabric8.openshift.client.dsl.BuildResource;
 import org.apache.camel.Exchange;
 import org.apache.camel.component.kubernetes.AbstractKubernetesEndpoint;
 import org.apache.camel.component.kubernetes.KubernetesConstants;
-import org.apache.camel.component.kubernetes.KubernetesEndpoint;
 import org.apache.camel.component.kubernetes.KubernetesOperations;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.camel.util.MessageHelper;
@@ -48,7 +49,7 @@ public class KubernetesBuildsProducer extends DefaultProducer {
 
     @Override
     public AbstractKubernetesEndpoint getEndpoint() {
-        return (AbstractKubernetesEndpoint) super.getEndpoint();
+        return (AbstractKubernetesEndpoint)super.getEndpoint();
     }
 
     @Override
@@ -81,26 +82,24 @@ public class KubernetesBuildsProducer extends DefaultProducer {
     }
 
     protected void doList(Exchange exchange, String operation) throws Exception {
-        BuildList buildList = getEndpoint().getKubernetesClient().adapt(OpenShiftClient.class).builds().list();
+        BuildList buildList = getEndpoint().getKubernetesClient().adapt(OpenShiftClient.class).builds().inAnyNamespace().list();
         exchange.getOut().setBody(buildList.getItems());
     }
 
     protected void doListBuildByLabels(Exchange exchange, String operation) throws Exception
{
         BuildList buildList = null;
-        Map<String, String> labels = exchange.getIn().getHeader(KubernetesConstants.KUBERNETES_BUILDS_LABELS,
-                Map.class);
+        Map<String, String> labels = exchange.getIn().getHeader(KubernetesConstants.KUBERNETES_BUILDS_LABELS,
Map.class);
         String namespaceName = exchange.getIn().getHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME,
String.class);
         if (!ObjectHelper.isEmpty(namespaceName)) {
-            NonNamespaceOperation<Build, BuildList, DoneableBuild, BuildResource<Build,
DoneableBuild, String, LogWatch>> builds = getEndpoint().getKubernetesClient().
-                adapt(OpenShiftClient.class).builds()
-                .inNamespace(namespaceName);
+            NonNamespaceOperation<Build, BuildList, DoneableBuild, BuildResource<Build,
DoneableBuild, String, LogWatch>> builds = getEndpoint().getKubernetesClient()
+                .adapt(OpenShiftClient.class).builds().inNamespace(namespaceName);
             for (Map.Entry<String, String> entry : labels.entrySet()) {
                 builds.withLabel(entry.getKey(), entry.getValue());
             }
             buildList = builds.list();
         } else {
-            MixedOperation<Build, BuildList, DoneableBuild, BuildResource<Build, DoneableBuild,
String, LogWatch>> builds = getEndpoint().getKubernetesClient().
-                adapt(OpenShiftClient.class).builds();
+            FilterWatchListMultiDeletable<Build, BuildList, Boolean, Watch, Watcher<Build>>
builds = getEndpoint().getKubernetesClient().adapt(OpenShiftClient.class).builds()
+                .inAnyNamespace();
             for (Map.Entry<String, String> entry : labels.entrySet()) {
                 builds.withLabel(entry.getKey(), entry.getValue());
             }
@@ -122,9 +121,8 @@ public class KubernetesBuildsProducer extends DefaultProducer {
             LOG.error("Get a specific Build require specify a namespace name");
             throw new IllegalArgumentException("Get a specific Build require specify a namespace
name");
         }
-        build = getEndpoint().getKubernetesClient().adapt(OpenShiftClient.class).builds().inNamespace(namespaceName)
-                .withName(buildName).get();
-        
+        build = getEndpoint().getKubernetesClient().adapt(OpenShiftClient.class).builds().inNamespace(namespaceName).withName(buildName).get();
+
         MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
         exchange.getOut().setBody(build);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/deprecated/DeprecatedKubernetesBuildsProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/deprecated/DeprecatedKubernetesBuildsProducerTest.java
b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/deprecated/DeprecatedKubernetesBuildsProducerTest.java
index 1e12bc6..882fcc9 100644
--- a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/deprecated/DeprecatedKubernetesBuildsProducerTest.java
+++ b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/deprecated/DeprecatedKubernetesBuildsProducerTest.java
@@ -18,7 +18,9 @@ package org.apache.camel.component.kubernetes.deprecated;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.kubernetes.producer.KubernetesBuildsProducerTest;
+import org.junit.Ignore;
 
+@Ignore
 @Deprecated
 public class DeprecatedKubernetesBuildsProducerTest extends KubernetesBuildsProducerTest
{
 

http://git-wip-us.apache.org/repos/asf/camel/blob/cbbfcf88/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/producer/KubernetesBuildsProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/producer/KubernetesBuildsProducerTest.java
b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/producer/KubernetesBuildsProducerTest.java
index 9535c9d..c8595dd 100644
--- a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/producer/KubernetesBuildsProducerTest.java
+++ b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/producer/KubernetesBuildsProducerTest.java
@@ -21,52 +21,56 @@ import java.util.List;
 import java.util.Map;
 
 import io.fabric8.openshift.api.model.Build;
+import io.fabric8.openshift.api.model.BuildListBuilder;
+import io.fabric8.openshift.client.server.mock.OpenShiftServer;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.kubernetes.KubernetesConstants;
 import org.apache.camel.component.kubernetes.KubernetesTestSupport;
-import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.impl.JndiRegistry;
+import org.junit.Rule;
 import org.junit.Test;
 
 public class KubernetesBuildsProducerTest extends KubernetesTestSupport {
 
+    @Rule
+    public OpenShiftServer server = new OpenShiftServer();
+
+    @Override
+    protected JndiRegistry createRegistry() throws Exception {
+        JndiRegistry registry = super.createRegistry();
+        registry.bind("client", server.getKubernetesClient());
+        return registry;
+    }
+
     @Test
     public void listTest() throws Exception {
-        if (ObjectHelper.isEmpty(authToken)) {
-            return;
-        }
-        List<Build> result = template.requestBody("direct:list", "",
-                List.class);
+        server.expect().withPath("/oapi/v1/builds").andReturn(200, new BuildListBuilder().addNewItem().and().addNewItem().and().build()).once();
+        List<Build> result = template.requestBody("direct:list", "", List.class);
 
-        assertTrue(result.size() == 0);
+        assertEquals(2, result.size());
     }
 
     @Test
     public void listByLabelsTest() throws Exception {
-        if (ObjectHelper.isEmpty(authToken)) {
-            return;
-        }
+        server.expect().withPath("/oapi/v1/builds?labelSelector=" + toUrlEncoded("key1=value1,key2=value2"))
+            .andReturn(200, new BuildListBuilder().addNewItem().and().addNewItem().and().build()).once();
         Exchange ex = template.request("direct:listByLabels", new Processor() {
 
             @Override
             public void process(Exchange exchange) throws Exception {
-                exchange.getIn().setHeader(
-                        KubernetesConstants.KUBERNETES_NAMESPACE_NAME,
-                        "default");
                 Map<String, String> labels = new HashMap<String, String>();
-                labels.put("component", "elasticsearch");
-                exchange.getIn()
-                        .setHeader(
-                                KubernetesConstants.KUBERNETES_BUILDS_LABELS,
-                                labels);
+                labels.put("key1", "value1");
+                labels.put("key2", "value2");
+                exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_BUILDS_LABELS,
labels);
             }
         });
 
         List<Build> result = ex.getOut().getBody(List.class);
-        
-        assertTrue(result.size() == 0);
+
+        assertEquals(2, result.size());
     }
 
     @Override
@@ -74,13 +78,13 @@ public class KubernetesBuildsProducerTest extends KubernetesTestSupport
{
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:list")
-                        .toF("kubernetes-builds://%s?oauthToken=%s&operation=listBuilds",
-                                host, authToken);
-                from("direct:listByLabels")
-                        .toF("kubernetes-builds://%s?oauthToken=%s&operation=listBuildsByLabels",
-                                host, authToken);
+                from("direct:list").to("kubernetes-builds:///?operation=listBuilds&kubernetesClient=#client");
+                from("direct:listByLabels").to("kubernetes-builds:///?operation=listBuildsByLabels&kubernetesClient=#client");
             }
         };
     }
+
+    private static String toUrlEncoded(String str) {
+        return str.replaceAll("=", "%3D");
+    }
 }


Mime
View raw message