X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebPageTest.java;h=2825a208b4828e322181d8b0cd31b8d178ecbf3f;hb=8aebcf573e7b5ef8b7b09f1c90c4f12a82920b64;hp=5a1d589670a802788264951beea70655e21e5302;hpb=52f3202e3d96c1c2d5dc60ac1d5fa7e3b340a45f;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 5a1d589..2825a20 100644 --- a/src/test/java/net/pterodactylus/sone/web/WebPageTest.java +++ b/src/test/java/net/pterodactylus/sone/web/WebPageTest.java @@ -103,6 +103,7 @@ public abstract class WebPageTest { public final void setupWebInterface() { when(webInterface.getCurrentSone(toadletContext)).thenReturn(currentSone); when(webInterface.getCurrentSone(eq(toadletContext), anyBoolean())).thenReturn(currentSone); + when(webInterface.getNotification(anyString())).thenReturn(Optional.absent()); when(webInterface.getNotifications(currentSone)).thenReturn(new ArrayList()); } @@ -164,4 +165,8 @@ public abstract class WebPageTest { when(core.getImage(eq(imageId), anyBoolean())).thenReturn(image); } + protected void addNotification(String notificationId, Notification notification) { + when(webInterface.getNotification(eq(notificationId))).thenReturn(Optional.of(notification)); + } + }