From 02bf56efeee6654cd6ed0b92074e09180b7fb0b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 28 Oct 2013 21:50:54 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20use=20an=20argument=20captor=20w?= =?utf8?q?hen=20using=20an=20answer.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/test/java/net/pterodactylus/sone/data/Mocks.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/java/net/pterodactylus/sone/data/Mocks.java b/src/test/java/net/pterodactylus/sone/data/Mocks.java index e1b9102..34aff9b 100644 --- a/src/test/java/net/pterodactylus/sone/data/Mocks.java +++ b/src/test/java/net/pterodactylus/sone/data/Mocks.java @@ -63,11 +63,10 @@ public class Mocks { when(sone.isLocal()).thenReturn(true); final Database database = core.getDatabase(); when(sone.newPostBuilder()).thenReturn(new DefaultPostBuilder(database, id)); - final ArgumentCaptor postIdCaptor = forClass(String.class); - when(sone.newPostReplyBuilder(postIdCaptor.capture())).then(new Answer() { + when(sone.newPostReplyBuilder(anyString())).then(new Answer() { @Override - public PostReplyBuilder answer(InvocationOnMock invocationOnMock) throws Throwable { - return new DefaultPostReplyBuilder(database, id, postIdCaptor.getValue()); + public PostReplyBuilder answer(InvocationOnMock invocation) throws Throwable { + return new DefaultPostReplyBuilder(database, id, (String) invocation.getArguments()[0]); } }); return sone; -- 2.7.4