From bce70170ce5ddaa142e67fcc67985215e1eadac2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 May 2019 22:44:36 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Use=20@TemplatePath=20annotations=20?= =?utf8?q?on=20most=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/CreatePostPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/DeletePostPage.kt | 1 + .../net/pterodactylus/sone/web/pages/DeleteProfileFieldPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt | 1 + .../kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt | 1 + .../kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt | 3 ++- src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/UploadImagePage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt | 1 + src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt | 5 +++++ .../kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt | 4 ++++ .../kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/CreatePostPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/CreateReplyPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt | 5 +++++ .../kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/DeleteImagePageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/DeletePostPageTest.kt | 6 ++++++ .../net/pterodactylus/sone/web/pages/DeleteProfileFieldPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/DeleteSonePageTest.kt | 5 +++++ .../net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt | 5 +++++ .../kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt | 5 +++++ src/test/kotlin/net/pterodactylus/sone/web/pages/IndexPageTest.kt | 5 +++++ .../kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt | 5 +++++ src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt | 5 +++++ src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt | 5 +++++ src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt | 5 +++++ src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt | 5 +++++ src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/UploadImagePageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/ViewPostPageTest.kt | 6 ++++++ .../kotlin/net/pterodactylus/sone/web/pages/ViewSonePageTest.kt | 6 ++++++ 50 files changed, 163 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt index 3e2820e..7c53a08 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt @@ -11,6 +11,7 @@ import javax.inject.Inject * A [SoneTemplatePage] that stores information about Sone in the [TemplateContext]. */ @MenuName("About") +@TemplatePath("/templates/about.html") class AboutPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer, private val pluginVersion: PluginVersion, private val pluginYear: PluginYear, diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt index c021d0a..7b4cbdc 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt @@ -13,6 +13,7 @@ import javax.inject.Inject * Page that lets the user browse all his bookmarked posts. */ @MenuName("Bookmarks") +@TemplatePath("/templates/bookmarks.html") class BookmarksPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : SoneTemplatePage("bookmarks.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.Bookmarks.Title") { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPage.kt index 3ffd622..98c2143 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPage.kt @@ -14,6 +14,7 @@ import javax.inject.Inject /** * Page that lets the user create a new album. */ +@TemplatePath("/templates/createAlbum.html") class CreateAlbumPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("createAlbum.html", template, "Page.CreateAlbum.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreatePostPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreatePostPage.kt index 9f57ef5..b1d62b3 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreatePostPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreatePostPage.kt @@ -14,6 +14,7 @@ import javax.inject.Inject /** * This page lets the user create a new [Post]. */ +@TemplatePath("/templates/createPost.html") class CreatePostPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("createPost.html", template, "Page.CreatePost.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPage.kt index 3e8bc72..d38a6ce 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPage.kt @@ -13,6 +13,7 @@ import javax.inject.Inject /** * This page lets the user post a reply to a post. */ +@TemplatePath("/templates/createReply.html") class CreateReplyPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("createReply.html", template, "Page.CreateReply.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt index 0acc0bd..6c39248 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt @@ -16,6 +16,7 @@ import javax.inject.Inject * The “create Sone” page lets the user create a new Sone. */ @MenuName("CreateSone") +@TemplatePath("/templates/createSone.html") class CreateSonePage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): SoneTemplatePage("createSone.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.CreateSone.Title") { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPage.kt index b1969cc..ba61ad2 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPage.kt @@ -12,6 +12,7 @@ import javax.inject.Inject /** * Page that lets the user delete an {@link Album}. */ +@TemplatePath("/templates/deleteAlbum.html") class DeleteAlbumPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("deleteAlbum.html", template, "Page.DeleteAlbum.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePage.kt index 755cfaa..c0d43aa 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePage.kt @@ -12,6 +12,7 @@ import javax.inject.Inject /** * Page that lets the user delete an {@link Image}. */ +@TemplatePath("/templates/deleteImage.html") class DeleteImagePage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("deleteImage.html", template, "Page.DeleteImage.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeletePostPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeletePostPage.kt index f9daed5..17b1616 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeletePostPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeletePostPage.kt @@ -12,6 +12,7 @@ import javax.inject.Inject /** * Lets the user delete a post they made. */ +@TemplatePath("/templates/deletePost.html") class DeletePostPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("deletePost.html", template, "Page.DeletePost.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPage.kt index 49cdbdf..348b81c 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPage.kt @@ -12,6 +12,7 @@ import javax.inject.Inject /** * Page that lets the user confirm the deletion of a profile field. */ +@TemplatePath("/templates/deleteProfileField.html") class DeleteProfileFieldPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("deleteProfileField.html", template, "Page.DeleteProfileField.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt index 85f1f21..9857e69 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt @@ -12,6 +12,7 @@ import javax.inject.Inject /** * This page lets the user delete a reply. */ +@TemplatePath("/templates/deleteReply.html") class DeleteReplyPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("deleteReply.html", template, "Page.DeleteReply.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt index ceaa1e2..ec3319e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt @@ -15,6 +15,7 @@ import javax.inject.Inject * installation. */ @MenuName("DeleteSone") +@TemplatePath("/templates/deleteSone.html") class DeleteSonePage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("deleteSone.html", template, "Page.DeleteSone.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPage.kt index 0ea1fb7..cf23d47 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPage.kt @@ -12,6 +12,7 @@ import javax.inject.Inject /** * Page that lets the user edit the name of a profile field. */ +@TemplatePath("/templates/editProfileField.html") class EditProfileFieldPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : LoggedInPage("editProfileField.html", template, "Page.EditProfileField.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt index b7524d0..ff9faab 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt @@ -15,6 +15,7 @@ import javax.inject.Inject * This page lets the user edit her profile. */ @MenuName("EditProfile") +@TemplatePath("/templates/editProfile.html") class EditProfilePage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : LoggedInPage("editProfile.html", template, "Page.EditProfile.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt index 5a5959e..10e6a0c 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt @@ -16,6 +16,7 @@ import javax.inject.Inject * The image browser page is the entry page for the image management. */ @MenuName("ImageBrowser") +@TemplatePath("/templates/imageBrowser.html") class ImageBrowserPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("imageBrowser.html", template, "Page.ImageBrowser.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt index a6a5683..89cd359 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt @@ -16,6 +16,7 @@ import javax.inject.Inject * of all friends of the current user. */ @MenuName("Index") +@TemplatePath("/templates/index.html") class IndexPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer, private val postVisibilityFilter: PostVisibilityFilter) : LoggedInPage("index.html", template, "Page.Index.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt index 0e890cc..b795f15 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt @@ -14,6 +14,7 @@ import javax.inject.Inject * This page shows all known Sones. */ @MenuName("KnownSones") +@TemplatePath("/templates/knownSones.html") class KnownSonesPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): SoneTemplatePage("knownSones.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.KnownSones.Title") { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt index 8f65b33..8e927c5 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt @@ -15,6 +15,7 @@ import javax.inject.Inject * The login page lets the user log in. */ @MenuName("Login") +@TemplatePath("/templates/login.html") class LoginPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): SoneTemplatePage("login.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.Login.Title") { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt index 874c157..149f5ea 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt @@ -15,7 +15,8 @@ import javax.inject.Inject * [PostVisibilityFilter.isPostVisible(Sone, Post)] and sorted by time. */ @MenuName("New") -class NewPage @Inject constructor( template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): +@TemplatePath("/templates/new.html") +class NewPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): SoneTemplatePage("new.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.New.Title") { override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) = diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt index 708b918..4bf6b12 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt @@ -17,6 +17,7 @@ import javax.inject.Inject * This page lets the user edit the options of the Sone plugin. */ @MenuName("Options") +@TemplatePath("/templates/options.html") class OptionsPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): SoneTemplatePage("options.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.Options.Title") { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt index 6546bdc..261074e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt @@ -14,6 +14,7 @@ import javax.inject.Inject * Page that lets the user control the rescue mode for a Sone. */ @MenuName("Rescue") +@TemplatePath("/templates/rescue.html") class RescuePage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("rescue.html", template, "Page.Rescue.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt index b44a94e..550e3f1 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt @@ -29,6 +29,7 @@ import javax.inject.Inject * This page lets the user search for posts and replies that contain certain * words. */ +@TemplatePath("/templates/search.html") class SearchPage(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer, ticker: Ticker = Ticker.systemTicker()) : SoneTemplatePage("search.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.Search.Title") { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/UploadImagePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/UploadImagePage.kt index 0a31e4f..32eec71 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/UploadImagePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/UploadImagePage.kt @@ -22,6 +22,7 @@ import javax.inject.Inject /** * Page implementation that lets the user upload an image. */ +@TemplatePath("/templates/invalid.html") class UploadImagePage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): LoggedInPage("uploadImage.html", template, "Page.UploadImage.Title", webInterface, loaders, templateRenderer) { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt index 1067698..941f040 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt @@ -12,6 +12,7 @@ import javax.inject.* /** * This page lets the user view a post and all its replies. */ +@TemplatePath("/templates/viewPost.html") class ViewPostPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): SoneTemplatePage("viewPost.html", webInterface, loaders, template, templateRenderer, pageTitleKey = "Page.ViewPost.Title") { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt index 38868e2..b1d36c5 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt @@ -17,6 +17,7 @@ import javax.inject.Inject /** * Lets the user browser another Sone. */ +@TemplatePath("/templates/viewSone.html") class ViewSonePage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): SoneTemplatePage("viewSone.html", webInterface, loaders, template, templateRenderer) { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt index 947262a..a2fd178 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt @@ -64,4 +64,9 @@ class AboutPageTest : WebPageTest({ template, webInterface, loaders, templateRen assertThat(page.menuName, equalTo("About")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/about.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt index b3882e5..a9891aa 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt @@ -70,5 +70,9 @@ class BookmarksPageTest: WebPageTest(::BookmarksPage) { assertThat(page.menuName, equalTo("Bookmarks")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/bookmarks.html")) + } } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPageTest.kt index 921313d..b0db24d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateAlbumPageTest.kt @@ -8,6 +8,7 @@ import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.selfMock import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -104,4 +105,9 @@ class CreateAlbumPageTest : WebPageTest(::CreateAlbumPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/createAlbum.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreatePostPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreatePostPageTest.kt index dccce87..ef54172 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreatePostPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreatePostPageTest.kt @@ -6,6 +6,7 @@ import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.utils.asOptional import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -96,4 +97,9 @@ class CreatePostPageTest: WebPageTest(::CreatePostPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/createPost.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPageTest.kt index 4cd67c9..ec56267 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateReplyPageTest.kt @@ -5,6 +5,7 @@ import net.pterodactylus.sone.data.Sone import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -93,4 +94,9 @@ class CreateReplyPageTest: WebPageTest(::CreateReplyPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/createReply.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt index 9b5f983..e865f65 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt @@ -156,4 +156,9 @@ class CreateSonePageTest : WebPageTest(::CreateSonePage) { assertThat(page.menuName, equalTo("CreateSone")) } + @Test + fun `page is annotated with the correct template path`() { + assertThat(page.templatePath, equalTo("/templates/createSone.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt index 95ffa00..28f7880 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt @@ -6,6 +6,7 @@ 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 net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -112,4 +113,9 @@ class DeleteAlbumPageTest: WebPageTest(::DeleteAlbumPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/deleteAlbum.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePageTest.kt index 2275108..65f2516 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteImagePageTest.kt @@ -7,6 +7,7 @@ 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 net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -88,4 +89,9 @@ class DeleteImagePageTest: WebPageTest(::DeleteImagePage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/deleteImage.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeletePostPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeletePostPageTest.kt index 3c18fb4..e6f386a 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeletePostPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeletePostPageTest.kt @@ -6,6 +6,7 @@ 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 net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -110,4 +111,9 @@ class DeletePostPageTest: WebPageTest(::DeletePostPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/deletePost.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPageTest.kt index 0baaffe..678991d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteProfileFieldPageTest.kt @@ -4,6 +4,7 @@ import net.pterodactylus.sone.data.Profile import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -83,4 +84,9 @@ class DeleteProfileFieldPageTest: WebPageTest(::DeleteProfileFieldPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/deleteProfileField.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt index 5cc0e7f..fbec0d5 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt @@ -6,6 +6,7 @@ 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 net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -103,4 +104,9 @@ class DeleteReplyPageTest: WebPageTest(::DeleteReplyPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/deleteReply.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePageTest.kt index 5551e76..3d53b01 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePageTest.kt @@ -66,4 +66,9 @@ class DeleteSonePageTest: WebPageTest(::DeleteSonePage) { assertThat(page.menuName, equalTo("DeleteSone")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/deleteSone.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt index cff74ac..39bb25d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt @@ -4,6 +4,7 @@ import net.pterodactylus.sone.data.Profile import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -101,4 +102,9 @@ class EditProfileFieldPageTest: WebPageTest(::EditProfileFieldPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/editProfileField.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt index 45af39d..be34861 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt @@ -231,4 +231,9 @@ class EditProfilePageTest: WebPageTest(::EditProfilePage) { assertThat(page.menuName, equalTo("EditProfile")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/editProfile.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt index faf70b8..0ec7898 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt @@ -148,4 +148,9 @@ class ImageBrowserPageTest: WebPageTest(::ImageBrowserPage) { assertThat(page.menuName, equalTo("ImageBrowser")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/imageBrowser.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/IndexPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/IndexPageTest.kt index 9a55a00..09bf4a0 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/IndexPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/IndexPageTest.kt @@ -165,4 +165,9 @@ class IndexPageTest: WebPageTest({ template, webInterface, loaders, templateRend assertThat(page.menuName, equalTo("Index")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/index.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt index bc46b9d..1c9ff0e 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt @@ -256,4 +256,9 @@ class KnownSonesPageTest: WebPageTest(::KnownSonesPage) { assertThat(page.menuName, equalTo("KnownSones")) } + @Test + fun `page is annotated with corrrect template path`() { + assertThat(page.templatePath, equalTo("/templates/knownSones.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt index 794e68b..8748aa0 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt @@ -152,4 +152,9 @@ class LoginPageTest: WebPageTest(::LoginPage) { assertThat(page.menuName, equalTo("Login")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/login.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt index 3a0f34c..2edf1dd 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt @@ -95,4 +95,9 @@ class NewPageTest: WebPageTest(::NewPage) { assertThat(page.menuName, equalTo("New")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/new.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt index ecee2f4..147f45c 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt @@ -390,4 +390,9 @@ class OptionsPageTest: WebPageTest(::OptionsPage) { assertThat(page.menuName, equalTo("Options")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/options.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt index 028119f..0738baa 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt @@ -99,4 +99,9 @@ class RescuePageTest: WebPageTest(::RescuePage) { assertThat(page.menuName, equalTo("Rescue")) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/rescue.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt index 89c3dda..02e8ed7 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt @@ -14,6 +14,7 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.utils.asOptional import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.contains import org.hamcrest.Matchers.equalTo @@ -372,4 +373,9 @@ class SearchPageTest: WebPageTest({ template, webInterface, loaders, templateRen assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/search.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/UploadImagePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/UploadImagePageTest.kt index 1af2f72..1d5d94d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/UploadImagePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/UploadImagePageTest.kt @@ -10,6 +10,7 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.mockBuilder import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -123,4 +124,9 @@ class UploadImagePageTest: WebPageTest(::UploadImagePage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/invalid.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewPostPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewPostPageTest.kt index cf92bde..0b50370 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewPostPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewPostPageTest.kt @@ -6,6 +6,7 @@ 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 net.pterodactylus.sone.web.page.* import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.hamcrest.Matchers.notNullValue @@ -106,4 +107,9 @@ class ViewPostPageTest: WebPageTest(::ViewPostPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/viewPost.html")) + } + } diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewSonePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewSonePageTest.kt index ee311e2..dc586bd 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewSonePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/ViewSonePageTest.kt @@ -11,6 +11,7 @@ import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.utils.Pagination import net.pterodactylus.sone.utils.asOptional import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.contains import org.hamcrest.Matchers.equalTo @@ -213,4 +214,9 @@ class ViewSonePageTest: WebPageTest(::ViewSonePage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/viewSone.html")) + } + } -- 2.7.4