From 1a814936923d374497bf3a7174c9a8be54a0f4d3 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:00 +0100 Subject: [PATCH] Mock local Sones by mocking remote Sones and re-mocking some methods. --- src/test/java/net/pterodactylus/sone/data/Mocks.java | 5 +---- 1 file changed, 1 insertion(+), 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 7ee612d..fd95180 100644 --- a/src/test/java/net/pterodactylus/sone/data/Mocks.java +++ b/src/test/java/net/pterodactylus/sone/data/Mocks.java @@ -59,8 +59,7 @@ public class Mocks { } public static Sone mockLocalSone(Core core, final String id) { - Sone sone = mock(Sone.class); - when(sone.getId()).thenReturn(id); + Sone sone = mockRemoteSone(core, id); when(sone.isLocal()).thenReturn(true); final Database database = core.getDatabase(); when(sone.newPostBuilder()).thenReturn(new DefaultPostBuilder(database, id)); @@ -71,8 +70,6 @@ public class Mocks { return new DefaultPostReplyBuilder(database, id, postIdCaptor.getValue()); } }); - when(core.getSone(eq(id))).thenReturn(of(sone)); - when(database.getSone(eq(id))).thenReturn(of(sone)); return sone; } -- 2.7.4