You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2017/10/31 20:00:15 UTC

[camel] branch master updated: CAMEL-11869: Upgrade mockito-core to 2.11.0 for camel-groovy, camel-json-validator and camel-kura

This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new cfdf4b5  CAMEL-11869: Upgrade mockito-core to 2.11.0 for camel-groovy, camel-json-validator and camel-kura
cfdf4b5 is described below

commit cfdf4b5499b7c23adee41634a019672ae5d4b32d
Author: aldettinger <al...@gmail.com>
AuthorDate: Tue Oct 31 20:24:41 2017 +0100

    CAMEL-11869: Upgrade mockito-core to 2.11.0 for camel-groovy, camel-json-validator and camel-kura
---
 components/camel-groovy/pom.xml                                   | 1 +
 .../org/apache/camel/language/groovy/GroovyShellFactoryTest.java  | 2 +-
 .../org/apache/camel/processor/groovy/GroovySumFilterTest.java    | 4 ++--
 components/camel-json-validator/pom.xml                           | 5 -----
 components/camel-kura/pom.xml                                     | 1 +
 .../test/java/org/apache/camel/component/kura/KuraRouterTest.java | 8 +++++---
 6 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/components/camel-groovy/pom.xml b/components/camel-groovy/pom.xml
index 11467f0..d71291b 100644
--- a/components/camel-groovy/pom.xml
+++ b/components/camel-groovy/pom.xml
@@ -85,6 +85,7 @@
     <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
+      <version>${mockito2-version}</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyShellFactoryTest.java b/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyShellFactoryTest.java
index 31f8674..e06f2f7 100644
--- a/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyShellFactoryTest.java
+++ b/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyShellFactoryTest.java
@@ -25,8 +25,8 @@ import org.apache.camel.impl.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
diff --git a/components/camel-groovy/src/test/java/org/apache/camel/processor/groovy/GroovySumFilterTest.java b/components/camel-groovy/src/test/java/org/apache/camel/processor/groovy/GroovySumFilterTest.java
index 289d27c..d440786 100644
--- a/components/camel-groovy/src/test/java/org/apache/camel/processor/groovy/GroovySumFilterTest.java
+++ b/components/camel-groovy/src/test/java/org/apache/camel/processor/groovy/GroovySumFilterTest.java
@@ -39,7 +39,7 @@ public class GroovySumFilterTest extends CamelSpringTestSupport {
         getMockEndpoint("mock:high").expectedMessageCount(1);
         getMockEndpoint("mock:low").expectedMessageCount(0);
 
-        List orders = new ArrayList();
+        List<Order> orders = new ArrayList<>();
         orders.add(new Order("Camel in Action", 50));
         orders.add(new Order("ActiveMQ in Action", 40));
         orders.add(new Order("Spring in Action", 60));
@@ -54,7 +54,7 @@ public class GroovySumFilterTest extends CamelSpringTestSupport {
         getMockEndpoint("mock:high").expectedMessageCount(0);
         getMockEndpoint("mock:low").expectedMessageCount(1);
 
-        List orders = new ArrayList();
+        List<Order> orders = new ArrayList<>();
         orders.add(new Order("Camel in Action", 50));
         orders.add(new Order("ActiveMQ in Action", 40));
 
diff --git a/components/camel-json-validator/pom.xml b/components/camel-json-validator/pom.xml
index ee5d96b..8d6f774 100644
--- a/components/camel-json-validator/pom.xml
+++ b/components/camel-json-validator/pom.xml
@@ -62,11 +62,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-test</artifactId>
       <scope>test</scope>
diff --git a/components/camel-kura/pom.xml b/components/camel-kura/pom.xml
index 15e85c6..2e36dbe 100644
--- a/components/camel-kura/pom.xml
+++ b/components/camel-kura/pom.xml
@@ -96,6 +96,7 @@
     <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
+      <version>${mockito2-version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
diff --git a/components/camel-kura/src/test/java/org/apache/camel/component/kura/KuraRouterTest.java b/components/camel-kura/src/test/java/org/apache/camel/component/kura/KuraRouterTest.java
index 81ba135..e2b2b6a 100644
--- a/components/camel-kura/src/test/java/org/apache/camel/component/kura/KuraRouterTest.java
+++ b/components/camel-kura/src/test/java/org/apache/camel/component/kura/KuraRouterTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.kura;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Dictionary;
 import java.util.Hashtable;
 
@@ -33,9 +34,9 @@ import org.osgi.framework.ServiceReference;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;   
 import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
 import static org.mockito.Mockito.mock;
 
@@ -113,7 +114,8 @@ public class KuraRouterTest extends Assert {
         // Given
         given(configurationAdmin.getConfiguration(anyString())).willReturn(configuration);
         Dictionary<String, Object> properties = new Hashtable<>();
-        properties.put("kura.camel.symbolic_name.route", IOUtils.toString(getClass().getResource("/route.xml")));
+        String routeDefinition = IOUtils.toString(getClass().getResource("/route.xml"), StandardCharsets.UTF_8);
+        properties.put("kura.camel.symbolic_name.route", routeDefinition);
         given(configuration.getProperties()).willReturn(properties);
 
         // When

-- 
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].