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=14427ef2c420d439b562f4eb69c662e8c928d6c3;hpb=ab598a7019581eca9981cf1101b315e13a3bcbaa;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 14427ef..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.* @@ -283,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)) + } + }