import net.pterodactylus.sone.utils.parameters
import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.sone.web.page.FreenetRequest
+import javax.inject.Inject
/**
* Returns the translation for a given key as JSON object.
*/
-class GetTranslationAjaxPage(webInterface: WebInterface) : JsonPage("getTranslation.ajax", webInterface) {
+class GetTranslationAjaxPage @Inject constructor(webInterface: WebInterface) :
+ JsonPage("getTranslation.ajax", webInterface) {
override val needsFormPassword = false
override val requiresLogin = false
package net.pterodactylus.sone.web.ajax
+import net.pterodactylus.sone.test.getInstance
+import net.pterodactylus.sone.web.baseInjector
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.equalTo
+import org.hamcrest.Matchers.notNullValue
import org.junit.Test
/**
assertThat(json["value"]?.asText(), equalTo("bar"))
}
+ @Test
+ fun `page can be created by dependency injection`() {
+ assertThat(baseInjector.getInstance<GetTranslationAjaxPage>(), notNullValue())
+ }
+
}