X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FWebPageTest.kt;h=096b3e68ece01e734a3ce960afe068adddf345a4;hb=399632073484e68c7664af6b24f6fe45fdbbb6dd;hp=07ae727f0442708770aafc0ded25dc914a3de27d;hpb=d5cd41949b7e62fdc40ef7390661dcda8c18a139;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt index 07ae727..096b3e6 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt @@ -42,7 +42,6 @@ open class WebPageTest(pageSupplier: (WebInterface, Loaders, TemplateRenderer) - val core = webInterface.core val eventBus = mock() val preferences = Preferences(eventBus) - val sessionManager = mock() open val page by lazy { pageSupplier(webInterface, loaders, templateRenderer) } @@ -50,7 +49,6 @@ open class WebPageTest(pageSupplier: (WebInterface, Loaders, TemplateRenderer) - val freenetRequest = mock() init { - whenever(freenetRequest.sessionManager).thenReturn(sessionManager) whenever(freenetRequest.uri).thenReturn(mock()) } @@ -106,9 +104,8 @@ open class WebPageTest(pageSupplier: (WebInterface, Loaders, TemplateRenderer) - } private fun setupWebInterface() { - whenever(webInterface.sessionManager).thenReturn(sessionManager) whenever(webInterface.getCurrentSoneCreatingSession(eq(toadletContext))).thenReturn(currentSone) - whenever(webInterface.getCurrentSone(eq(toadletContext), anyBoolean())).thenReturn(currentSone) + whenever(webInterface.getCurrentSone(eq(toadletContext))).thenReturn(currentSone) whenever(webInterface.getCurrentSoneWithoutCreatingSession(eq(toadletContext))).thenReturn(currentSone) whenever(webInterface.getNotifications(currentSone)).then { notifications.values } whenever(webInterface.getNotification(anyString())).then { notifications[it[0]].asOptional() } @@ -176,7 +173,7 @@ open class WebPageTest(pageSupplier: (WebInterface, Loaders, TemplateRenderer) - fun unsetCurrentSone() { whenever(webInterface.getCurrentSoneCreatingSession(eq(toadletContext))).thenReturn(null) - whenever(webInterface.getCurrentSone(eq(toadletContext), anyBoolean())).thenReturn(null) + whenever(webInterface.getCurrentSone(eq(toadletContext))).thenReturn(null) whenever(webInterface.getCurrentSoneWithoutCreatingSession(eq(toadletContext))).thenReturn(null) }