X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterfaceModuleTest.kt;h=8840caf6436f7c15f4a71845a1e4512675d8b413;hb=7cb0100ec63244e5f64654947206b610f96b006f;hp=c03d9f894e583f0298147c76f987202dcf86aef9;hpb=88697e913d257bb78571616d2b377a9f61dd7421;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 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() } }