🔀 Merge branch 'release/v82'
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / pages / WebPageTest.kt
index 07ae727..badc2bc 100644 (file)
@@ -42,7 +42,6 @@ open class WebPageTest(pageSupplier: (WebInterface, Loaders, TemplateRenderer) -
        val core = webInterface.core
        val eventBus = mock<EventBus>()
        val preferences = Preferences(eventBus)
-       val sessionManager = mock<SessionManager>()
 
        open val page by lazy { pageSupplier(webInterface, loaders, templateRenderer) }
 
@@ -50,7 +49,6 @@ open class WebPageTest(pageSupplier: (WebInterface, Loaders, TemplateRenderer) -
        val freenetRequest = mock<FreenetRequest>()
 
        init {
-               whenever(freenetRequest.sessionManager).thenReturn(sessionManager)
                whenever(freenetRequest.uri).thenReturn(mock())
        }
 
@@ -106,10 +104,7 @@ 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.getCurrentSoneWithoutCreatingSession(eq(toadletContext))).thenReturn(currentSone)
+               whenever(webInterface.getCurrentSone(eq(toadletContext))).thenReturn(currentSone)
                whenever(webInterface.getNotifications(currentSone)).then { notifications.values }
                whenever(webInterface.getNotification(anyString())).then { notifications[it[0]].asOptional() }
                whenever(webInterface.translation).thenReturn(translation)
@@ -175,9 +170,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.getCurrentSoneWithoutCreatingSession(eq(toadletContext))).thenReturn(null)
+               whenever(webInterface.getCurrentSone(eq(toadletContext))).thenReturn(null)
        }
 
        fun addOwnIdentity(ownIdentity: OwnIdentity) {