You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2017/09/28 11:46:08 UTC

svn commit: r1809977 - in /sling/trunk/bundles/commons/threads: pom.xml src/test/java/org/apache/sling/commons/threads/impl/ThreadPoolExecutorCleaningThreadLocalsTest.java

Author: kwin
Date: Thu Sep 28 11:46:07 2017
New Revision: 1809977

URL: http://svn.apache.org/viewvc?rev=1809977&view=rev
Log:
upgrade to Mockito 2.x for better Java9 compatibility
also upgrade to latest parent

Modified:
    sling/trunk/bundles/commons/threads/pom.xml
    sling/trunk/bundles/commons/threads/src/test/java/org/apache/sling/commons/threads/impl/ThreadPoolExecutorCleaningThreadLocalsTest.java

Modified: sling/trunk/bundles/commons/threads/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/threads/pom.xml?rev=1809977&r1=1809976&r2=1809977&view=diff
==============================================================================
--- sling/trunk/bundles/commons/threads/pom.xml (original)
+++ sling/trunk/bundles/commons/threads/pom.xml Thu Sep 28 11:46:07 2017
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>30</version>
+        <version>32</version>
         <relativePath />
     </parent>
 
@@ -90,8 +90,9 @@
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <version>1.9.5</version>
+            <artifactId>mockito-core</artifactId>
+            <version>2.10.0</version>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/bundles/commons/threads/src/test/java/org/apache/sling/commons/threads/impl/ThreadPoolExecutorCleaningThreadLocalsTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/threads/src/test/java/org/apache/sling/commons/threads/impl/ThreadPoolExecutorCleaningThreadLocalsTest.java?rev=1809977&r1=1809976&r2=1809977&view=diff
==============================================================================
--- sling/trunk/bundles/commons/threads/src/test/java/org/apache/sling/commons/threads/impl/ThreadPoolExecutorCleaningThreadLocalsTest.java (original)
+++ sling/trunk/bundles/commons/threads/src/test/java/org/apache/sling/commons/threads/impl/ThreadPoolExecutorCleaningThreadLocalsTest.java Thu Sep 28 11:46:07 2017
@@ -29,10 +29,10 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
 
 @RunWith(MockitoJUnitRunner.class)
 public class ThreadPoolExecutorCleaningThreadLocalsTest {
@@ -57,9 +57,9 @@ public class ThreadPoolExecutorCleaningT
         assertTaskDoesNotSeeOldThreadLocals("test");
         assertTaskDoesNotSeeOldThreadLocals("test2");
         // verify mock interactions (at least the additions from the first task should be visible to the listener now)
-        Mockito.verify(listener).changed(Matchers.eq(Mode.ADDED), Matchers.any(Thread.class), Matchers.eq(ThreadLocalTask.threadLocalVariable), Matchers.eq("test"));
+        Mockito.verify(listener).changed(ArgumentMatchers.eq(Mode.ADDED), ArgumentMatchers.any(Thread.class), ArgumentMatchers.eq(ThreadLocalTask.threadLocalVariable), ArgumentMatchers.eq("test"));
         // no thread locals should have been removed
-        Mockito.verify(listener, Mockito.times(0)).changed(Matchers.eq(Mode.REMOVED), Matchers.any(Thread.class), Matchers.eq(ThreadLocalTask.threadLocalVariable), Matchers.anyString());
+        Mockito.verify(listener, Mockito.times(0)).changed(ArgumentMatchers.eq(Mode.REMOVED), ArgumentMatchers.any(Thread.class), ArgumentMatchers.eq(ThreadLocalTask.threadLocalVariable), ArgumentMatchers.anyString());
     }
 
     private void assertTaskDoesNotSeeOldThreadLocals(String value) throws InterruptedException, ExecutionException {