X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebPageTest.java;h=bb6282cfffa644f82ef5bdd9b3b645b3ab414e8c;hb=02bfd3cfcf4c78c4e7f561ef68dece9becaf8171;hp=f464eac180a9ece5ab4dc0274846bbefd497fea4;hpb=e3cfdd1ce056e81092f3dfd53cc7110999bd0540;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/web/WebPageTest.java b/src/test/java/net/pterodactylus/sone/web/WebPageTest.java index f464eac..bb6282c 100644 --- a/src/test/java/net/pterodactylus/sone/web/WebPageTest.java +++ b/src/test/java/net/pterodactylus/sone/web/WebPageTest.java @@ -70,6 +70,9 @@ public abstract class WebPageTest { public final void setupCore() { UpdateChecker updateChecker = mock(UpdateChecker.class); when(core.getUpdateChecker()).thenReturn(updateChecker); + when(core.getLocalSone(anyString())).thenReturn(null); + when(core.getSone(anyString())).thenReturn(Optional.absent()); + when(core.getPost(anyString())).thenReturn(Optional.absent()); } @Before @@ -102,4 +105,12 @@ public abstract class WebPageTest { when(core.getPost(postId)).thenReturn(Optional.fromNullable(post)); } + protected void addSone(String soneId, Sone sone) { + when(core.getSone(eq(soneId))).thenReturn(Optional.fromNullable(sone)); + } + + protected void addLocalSone(String soneId, Sone sone) { + when(core.getLocalSone(eq(soneId))).thenReturn(sone); + } + }