X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetNotificationsAjaxPageTest.kt;h=c9afbf090d99fa3a4d96c1063e0b5d4e4631d14c;hp=8f67ecfbf3cd2101c14f1061e98974a0e9f4fa90;hb=bf509980d5097e67d1a32f6b53bef052b396137f;hpb=fe880bd95f2f1bb155e890a9ffd2dc2abc86cb37 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))