Add test for DI constructability of SearchPage
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / SearchPage.kt
index f296e03..e94d879 100644 (file)
@@ -22,13 +22,17 @@ import net.pterodactylus.util.template.TemplateContext
 import net.pterodactylus.util.text.StringEscaper
 import net.pterodactylus.util.text.TextException
 import java.util.concurrent.TimeUnit.MINUTES
+import javax.inject.Inject
 
 /**
  * This page lets the user search for posts and replies that contain certain
  * words.
  */
-class SearchPage @JvmOverloads constructor(template: Template, webInterface: WebInterface, ticker: Ticker = Ticker.systemTicker()):
-               SoneTemplatePage("search.html", template, "Page.Search.Title", webInterface, false) {
+class SearchPage(template: Template, webInterface: WebInterface, ticker: Ticker = Ticker.systemTicker()) :
+               SoneTemplatePage("search.html", webInterface, template, "Page.Search.Title") {
+
+       @Inject constructor(template: Template, webInterface: WebInterface) :
+                       this(template, webInterface, Ticker.systemTicker())
 
        private val cache: Cache<Iterable<Phrase>, Pagination<Post>> = CacheBuilder.newBuilder().ticker(ticker).expireAfterAccess(5, MINUTES).build()