X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FAboutPageTest.kt;h=7856ee2b543ee4cbcc0baaac2652c0f411b2c564;hp=142bf819464a6af81fc691190706c355bac2203b;hb=a1d7f4217bc83b61673d49870e199478f20e0923;hpb=0219692c16d02db6cfe9fb4f0621ceefc8ec4cd2 diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt index 142bf81..7856ee2 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt @@ -1,10 +1,16 @@ package net.pterodactylus.sone.web.pages +import com.google.inject.Guice import net.pterodactylus.sone.main.SonePlugin.PluginHomepage import net.pterodactylus.sone.main.SonePlugin.PluginVersion import net.pterodactylus.sone.main.SonePlugin.PluginYear +import net.pterodactylus.sone.test.getInstance +import net.pterodactylus.sone.test.isProvidedByMock +import net.pterodactylus.sone.web.WebInterface +import net.pterodactylus.util.template.Template import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo +import org.hamcrest.Matchers.notNullValue import org.junit.Test /** @@ -46,4 +52,16 @@ class AboutPageTest: WebPageTest({ template, webInterface -> AboutPage(template, assertThat(templateContext["year"], equalTo(year)) } + @Test + fun `about page can be created by dependency injection`() { + val injector = Guice.createInjector( + Template::class.isProvidedByMock(), + WebInterface::class.isProvidedByMock(), + PluginVersion::class.isProvidedByMock(), + PluginYear::class.isProvidedByMock(), + PluginHomepage::class.isProvidedByMock() + ) + assertThat(injector.getInstance(), notNullValue()) + } + }