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=156b36195ab527a6523f3258a19abbc4eb664a55;hp=7856ee2b543ee4cbcc0baaac2652c0f411b2c564;hb=3db634e425d3482bcf00dfd82e4b0d46785d5959;hpb=a1d7f4217bc83b61673d49870e199478f20e0923 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 7856ee2..156b361 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt @@ -1,13 +1,9 @@ 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.main.* 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 net.pterodactylus.sone.web.baseInjector import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.hamcrest.Matchers.notNullValue @@ -16,7 +12,7 @@ import org.junit.Test /** * Unit test for [AboutPage]. */ -class AboutPageTest: WebPageTest({ template, webInterface -> AboutPage(template, webInterface, PluginVersion(version), PluginYear(year), PluginHomepage(homepage)) }) { +class AboutPageTest : WebPageTest({ template, webInterface -> AboutPage(template, webInterface, PluginVersion(version), PluginYear(year), PluginHomepage(homepage)) }) { companion object { private const val version = "0.1.2" @@ -54,9 +50,7 @@ class AboutPageTest: WebPageTest({ template, webInterface -> AboutPage(template, @Test fun `about page can be created by dependency injection`() { - val injector = Guice.createInjector( - Template::class.isProvidedByMock(), - WebInterface::class.isProvidedByMock(), + val injector = baseInjector.createChildInjector( PluginVersion::class.isProvidedByMock(), PluginYear::class.isProvidedByMock(), PluginHomepage::class.isProvidedByMock()