X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetNotificationsAjaxPageTest.kt;h=c9afbf090d99fa3a4d96c1063e0b5d4e4631d14c;hb=bc8f2705a88d987f597c925fab05b2eb1cf73daa;hp=8f67ecfbf3cd2101c14f1061e98974a0e9f4fa90;hpb=8a0e0ee93d2f49762d87c4897a3a4de7273b3046;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPageTest.kt index 8f67ecf..c9afbf0 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPageTest.kt @@ -25,7 +25,9 @@ import java.io.Writer /** * Unit test for [GetNotificationsAjaxPage]. */ -class GetNotificationsAjaxPageTest : JsonPageTest("getNotifications.ajax", requiresLogin = false, needsFormPassword = false, pageSupplier = ::GetNotificationsAjaxPage) { +class GetNotificationsAjaxPageTest : JsonPageTest("getNotifications.ajax", requiresLogin = false, needsFormPassword = false) { + + override val page: JsonPage by lazy { GetNotificationsAjaxPage(webInterface, TemplateContextFactory()) } private val testNotifications = listOf( createNotification("n1", 2000, "t1", 5000, true), @@ -89,7 +91,6 @@ class GetNotificationsAjaxPageTest : JsonPageTest("getNotifications.ajax", requi @Test fun `template notifications are rendered correctly`() { - whenever(webInterface.templateContextFactory).thenReturn(TemplateContextFactory()) whenever(updateChecker.hasLatestVersion()).thenReturn(true) whenever(updateChecker.latestEdition).thenReturn(999) whenever(updateChecker.latestVersion).thenReturn(Version(0, 1, 2))