X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterfaceModuleTest.kt;h=2bb31c94739e8ae1b0dfb5d7f4b131a0337dc001;hb=3b10e05d2dbe5588cd81732499ff6576b122795e;hp=4d8fc839b903b6892fecf0bbf2e685f7a57a0a2d;hpb=d5cd41949b7e62fdc40ef7390661dcda8c18a139;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt index 4d8fc83..2bb31c9 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt @@ -14,7 +14,9 @@ import net.pterodactylus.sone.main.* import net.pterodactylus.sone.template.* import net.pterodactylus.sone.test.* import net.pterodactylus.sone.text.* +import net.pterodactylus.sone.web.notification.* import net.pterodactylus.sone.web.page.* +import net.pterodactylus.util.notify.* import net.pterodactylus.util.template.* import net.pterodactylus.util.web.* import org.hamcrest.MatcherAssert.* @@ -243,6 +245,11 @@ class WebInterfaceModuleTest { verifyFilter("paginate") } + @Test + fun `template context histogram renderer`() { + verifyFilter("render-histogram") + } + private inline fun verifyFilter(name: String) { assertThat(getFilter(name), instanceOf(F::class.java)) } @@ -278,4 +285,23 @@ class WebInterfaceModuleTest { assertThat(injector.getInstance().createPageToadlet(page).path(), startsWith("/Sone/")) } + @Test + fun `notification manager is created as singleton`() { + val firstNotificationManager = injector.getInstance() + val secondNotificationManager = injector.getInstance() + assertThat(firstNotificationManager, sameInstance(secondNotificationManager)) + } + + @Test + fun `notification handler can be created`() { + assertThat(injector.getInstance(), notNullValue()) + } + + @Test + fun `notification handler is created as singleton`() { + val firstNotificationHandler = injector.getInstance() + val secondNotificationHandler = injector.getInstance() + assertThat(firstNotificationHandler, sameInstance(secondNotificationHandler)) + } + }