X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterfaceModuleTest.kt;h=8840caf6436f7c15f4a71845a1e4512675d8b413;hp=c03d9f894e583f0298147c76f987202dcf86aef9;hb=faf66247a34f64946990a985d2ea3003465969cb;hpb=52794964b8c5a870477fa26c5dfdcdf55ea44f91 diff --git a/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt index c03d9f8..8840caf 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/WebInterfaceModuleTest.kt @@ -256,9 +256,7 @@ class WebInterfaceModuleTest { @Test fun `template context factory is created as singleton`() { - val factory1 = injector.getInstance() - val factory2 = injector.getInstance() - assertThat(factory1, sameInstance(factory2)) + injector.verifySingletonInstance() } @Test @@ -280,26 +278,12 @@ class WebInterfaceModuleTest { @Test fun `page toadlet factory is created with correct prefix`() { val page = mock>() - assertThat(injector.getInstance().createPageToadlet(page).path(), startsWith("/Sone/")) + 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)) + injector.verifySingletonInstance() } }