Update mockito dependency to 2.1.0
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 8 Oct 2016 10:04:29 +0000 (12:04 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 8 Oct 2016 10:04:29 +0000 (12:04 +0200)
pom.xml
src/test/java/net/pterodactylus/sone/core/CoreTest.java
src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java
src/test/java/net/pterodactylus/sone/core/SoneInserterTest.java
src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java
src/test/java/net/pterodactylus/sone/notify/ListNotificationFilterTest.java
src/test/java/net/pterodactylus/sone/notify/ListNotificationTest.java
src/test/java/net/pterodactylus/sone/web/DeleteReplyPageTest.java
src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java

diff --git a/pom.xml b/pom.xml
index 9cf67f0..f180d73 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
                <dependency>
                        <groupId>org.mockito</groupId>
                        <artifactId>mockito-core</artifactId>
-                       <version>1.9.5</version>
+                       <version>2.1.0</version>
                        <scope>test</scope>
                </dependency>
                <dependency>
index 8e83e21..95f9dbf 100644 (file)
@@ -1,11 +1,11 @@
 package net.pterodactylus.sone.core;
 
-import static org.mockito.Matchers.argThat;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
 
 import net.pterodactylus.sone.core.Core.MarkPostKnown;
 import net.pterodactylus.sone.core.Core.MarkReplyKnown;
index 091c93f..c9257a6 100644 (file)
@@ -69,6 +69,7 @@ import com.google.common.eventbus.EventBus;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
 
 /**
  * Unit test for {@link FreenetInterface}.
@@ -198,7 +199,7 @@ public class FreenetInterfaceTest {
 
        @Test(expected = SoneException.class)
        public void insertExceptionIsForwardedAsSoneException() throws InsertException, SoneException {
-               when(highLevelSimpleClient.insertManifest(any(FreenetURI.class), any(HashMap.class), any(String.class))).thenThrow(InsertException.class);
+               when(highLevelSimpleClient.insertManifest(ArgumentMatchers.<FreenetURI>any(), ArgumentMatchers.<HashMap<String, Object>>any(), ArgumentMatchers.<String>any())).thenThrow(InsertException.class);
                freenetInterface.insertDirectory(null, null, null);
        }
 
index 1572191..23d9513 100644 (file)
@@ -11,7 +11,6 @@ import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.nullValue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.argThat;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
@@ -19,6 +18,7 @@ import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
 
 import java.io.IOException;
 import java.util.HashMap;
index 44819ee..e351d76 100644 (file)
@@ -6,12 +6,12 @@ import static org.hamcrest.Matchers.instanceOf;
 import static org.hamcrest.Matchers.is;
 import static org.mockito.ArgumentCaptor.forClass;
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.argThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
 
 import java.io.IOException;
 import java.io.InputStream;
index b29b2c1..d6724fa 100644 (file)
@@ -29,6 +29,7 @@ import com.google.inject.Guice;
 import com.google.inject.Injector;
 import org.hamcrest.Matchers;
 import org.junit.Test;
+import org.mockito.ArgumentMatchers;
 
 /**
  * Unit test for {@link ListNotificationFilterTest}.
@@ -117,7 +118,7 @@ public class ListNotificationFilterTest {
        }
 
        private void setPostVisibilityPredicate(Predicate<Post> value) {
-               when(postVisibilityFilter.isVisible(any(Sone.class))).thenReturn(value);
+               when(postVisibilityFilter.isVisible(ArgumentMatchers.<Sone>any())).thenReturn(value);
        }
 
        @Test
index c354afa..c832a9e 100644 (file)
@@ -4,11 +4,11 @@ import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.emptyIterable;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.not;
-import static org.mockito.Matchers.argThat;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
 
 import java.util.Arrays;
 
index 80c8a2f..f6e15af 100644 (file)
@@ -24,7 +24,6 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
-import org.mockito.Matchers;
 
 /**
  * Unit test for {@link DeleteReplyPage}.
@@ -45,7 +44,7 @@ public class DeleteReplyPageTest {
 
        @Before
        public void setupWebInterface() {
-               when(webInterface.getNotifications(Matchers.any(Sone.class))).thenReturn(Collections.<Notification>emptyList());
+               when(webInterface.getNotifications(any(Sone.class))).thenReturn(Collections.<Notification>emptyList());
        }
 
        @Before
index 5f2025f..bf182f4 100644 (file)
@@ -10,7 +10,6 @@ import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.junit.Assert.assertThat;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.argThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;