1 package net.pterodactylus.sone.web
3 import com.google.inject.Guice.createInjector
4 import net.pterodactylus.sone.core.Core
5 import net.pterodactylus.sone.core.FreenetInterface
6 import net.pterodactylus.sone.main.SonePlugin.PluginHomepage
7 import net.pterodactylus.sone.main.SonePlugin.PluginVersion
8 import net.pterodactylus.sone.main.SonePlugin.PluginYear
9 import net.pterodactylus.sone.test.getInstance
10 import net.pterodactylus.sone.test.isProvidedByMock
11 import net.pterodactylus.util.template.Template
12 import org.hamcrest.MatcherAssert.assertThat
13 import org.hamcrest.Matchers.notNullValue
17 * Test for [AllPages].
21 private val injector by lazy {
22 baseInjector.createChildInjector(
23 PluginVersion::class.isProvidedByMock(),
24 PluginYear::class.isProvidedByMock(),
25 PluginHomepage::class.isProvidedByMock()
28 private val allPages by lazy { injector.getInstance<AllPages>() }
31 fun `about page can be injected`() {
32 assertThat(allPages.aboutPage, notNullValue())
37 val baseInjector by lazy {
39 Core::class.isProvidedByMock(),
40 FreenetInterface::class.isProvidedByMock(),
41 Template::class.isProvidedByMock(),
42 WebInterface::class.isProvidedByMock()