import net.pterodactylus.util.template.Template
import net.pterodactylus.util.template.TemplateContext
import java.net.URI
+import javax.inject.Inject
/**
* The image browser page is the entry page for the image management.
*/
-class ImageBrowserPage(template: Template, webInterface: WebInterface):
+class ImageBrowserPage @Inject constructor(template: Template, webInterface: WebInterface):
LoggedInPage("imageBrowser.html", template, "Page.ImageBrowser.Title", webInterface) {
override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) {
import net.pterodactylus.sone.data.Album
import net.pterodactylus.sone.data.Image
import net.pterodactylus.sone.data.Sone
+import net.pterodactylus.sone.test.getInstance
import net.pterodactylus.sone.test.mock
import net.pterodactylus.sone.test.whenever
+import net.pterodactylus.sone.web.baseInjector
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.contains
import org.hamcrest.Matchers.equalTo
+import org.hamcrest.Matchers.notNullValue
import org.junit.Test
/**
assertThat(page.isLinkExcepted(null), equalTo(true))
}
+ @Test
+ fun `page can be created by dependency injection`() {
+ assertThat(baseInjector.getInstance<ImageBrowserPage>(), notNullValue())
+ }
+
}