import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.sone.web.page.FreenetRequest
import net.pterodactylus.util.template.Template
+import javax.inject.Inject
/**
* This AJAX handler retrieves information and rendered representation of a [Post].
*/
-class GetPostAjaxPage(webInterface: WebInterface, private val postTemplate: Template) : LoggedInJsonPage("getPost.ajax", webInterface) {
+class GetPostAjaxPage @Inject constructor(webInterface: WebInterface, private val postTemplate: Template) :
+ LoggedInJsonPage("getPost.ajax", webInterface) {
override val needsFormPassword = false
import net.pterodactylus.sone.data.Post
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.utils.asOptional
import net.pterodactylus.sone.utils.asTemplate
+import net.pterodactylus.sone.web.baseInjector
import net.pterodactylus.util.template.ReflectionAccessor
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.equalTo
+import org.hamcrest.Matchers.notNullValue
import org.junit.Test
/**
).joinToString("\n")))
}
+ @Test
+ fun `page can be created dependency injection`() {
+ assertThat(baseInjector.getInstance<GetPostAjaxPage>(), notNullValue())
+ }
+
}