From d9d178b845ae83155f22a52e4ea697359864883c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 8 Oct 2016 12:04:29 +0200 Subject: [PATCH] Update mockito dependency to 2.1.0 --- pom.xml | 2 +- src/test/java/net/pterodactylus/sone/core/CoreTest.java | 2 +- src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java | 3 ++- src/test/java/net/pterodactylus/sone/core/SoneInserterTest.java | 2 +- src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java | 2 +- .../java/net/pterodactylus/sone/notify/ListNotificationFilterTest.java | 3 ++- src/test/java/net/pterodactylus/sone/notify/ListNotificationTest.java | 2 +- src/test/java/net/pterodactylus/sone/web/DeleteReplyPageTest.java | 3 +-- .../java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java | 1 - 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 9cf67f0..f180d73 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ org.mockito mockito-core - 1.9.5 + 2.1.0 test diff --git a/src/test/java/net/pterodactylus/sone/core/CoreTest.java b/src/test/java/net/pterodactylus/sone/core/CoreTest.java index 8e83e21..95f9dbf 100644 --- a/src/test/java/net/pterodactylus/sone/core/CoreTest.java +++ b/src/test/java/net/pterodactylus/sone/core/CoreTest.java @@ -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; diff --git a/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java b/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java index 091c93f..c9257a6 100644 --- a/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java +++ b/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java @@ -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.any(), ArgumentMatchers.>any(), ArgumentMatchers.any())).thenThrow(InsertException.class); freenetInterface.insertDirectory(null, null, null); } diff --git a/src/test/java/net/pterodactylus/sone/core/SoneInserterTest.java b/src/test/java/net/pterodactylus/sone/core/SoneInserterTest.java index 1572191..23d9513 100644 --- a/src/test/java/net/pterodactylus/sone/core/SoneInserterTest.java +++ b/src/test/java/net/pterodactylus/sone/core/SoneInserterTest.java @@ -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; diff --git a/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java b/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java index 44819ee..e351d76 100644 --- a/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java +++ b/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java @@ -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; diff --git a/src/test/java/net/pterodactylus/sone/notify/ListNotificationFilterTest.java b/src/test/java/net/pterodactylus/sone/notify/ListNotificationFilterTest.java index b29b2c1..d6724fa 100644 --- a/src/test/java/net/pterodactylus/sone/notify/ListNotificationFilterTest.java +++ b/src/test/java/net/pterodactylus/sone/notify/ListNotificationFilterTest.java @@ -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 value) { - when(postVisibilityFilter.isVisible(any(Sone.class))).thenReturn(value); + when(postVisibilityFilter.isVisible(ArgumentMatchers.any())).thenReturn(value); } @Test diff --git a/src/test/java/net/pterodactylus/sone/notify/ListNotificationTest.java b/src/test/java/net/pterodactylus/sone/notify/ListNotificationTest.java index c354afa..c832a9e 100644 --- a/src/test/java/net/pterodactylus/sone/notify/ListNotificationTest.java +++ b/src/test/java/net/pterodactylus/sone/notify/ListNotificationTest.java @@ -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; diff --git a/src/test/java/net/pterodactylus/sone/web/DeleteReplyPageTest.java b/src/test/java/net/pterodactylus/sone/web/DeleteReplyPageTest.java index 80c8a2f..f6e15af 100644 --- a/src/test/java/net/pterodactylus/sone/web/DeleteReplyPageTest.java +++ b/src/test/java/net/pterodactylus/sone/web/DeleteReplyPageTest.java @@ -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.emptyList()); + when(webInterface.getNotifications(any(Sone.class))).thenReturn(Collections.emptyList()); } @Before diff --git a/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java b/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java index 5f2025f..bf182f4 100644 --- a/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java +++ b/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java @@ -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; -- 2.7.4