--- /dev/null
+package net.pterodactylus.sone.test
+
+import net.pterodactylus.util.web.*
+
+/**
+ * Dummy implementation of a [Page].
+ */
+class TestPage<REQ : Request> : Page<REQ> {
+
+ override fun getPath() = ""
+ override fun isPrefixPage() = false
+ override fun handleRequest(freenetRequest: REQ, response: Response) = response
+
+}
import net.pterodactylus.sone.main.*
import net.pterodactylus.sone.test.*
import net.pterodactylus.sone.web.page.*
-import net.pterodactylus.util.web.*
import org.junit.*
import org.junit.rules.*
import org.mockito.Mockito.*
verify(pageMaker).addNavigationCategory("/Sone/index.html", "Navigation.Menu.Sone.Name", "Navigation.Menu.Sone.Tooltip", sonePlugin)
}
- private val page = TestPage()
+ private val page = TestPage<FreenetRequest>()
@Test
fun `adding a page without menuname will add it correctly`() {
whenever(this.menuName).thenReturn(menuName)
}
- private class TestPage : Page<FreenetRequest> {
- override fun getPath() = ""
- override fun isPrefixPage() = false
- override fun handleRequest(freenetRequest: FreenetRequest, response: Response) = response
- }
-
}