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 page returns the details of a reply.
*/
-class GetReplyAjaxPage(webInterface: WebInterface, private val template: Template) : LoggedInJsonPage("getReply.ajax", webInterface) {
+class GetReplyAjaxPage @Inject constructor(webInterface: WebInterface, private val template: Template) :
+ LoggedInJsonPage("getReply.ajax", webInterface) {
override val needsFormPassword = false
import net.pterodactylus.sone.data.PostReply
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.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 by dependency injection`() {
+ assertThat(baseInjector.getInstance<GetReplyAjaxPage>(), notNullValue())
+ }
+
}