✨ Annotate LogoutPage with MenuName
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 10:07:39 +0000 (12:07 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 10:07:39 +0000 (12:07 +0200)
src/main/kotlin/net/pterodactylus/sone/web/pages/LogoutPage.kt
src/test/kotlin/net/pterodactylus/sone/web/pages/LogoutPageTest.kt

index 563f03b..6978739 100644 (file)
@@ -11,6 +11,7 @@ import javax.inject.Inject
 /**
  * Logs a user out.
  */
+@MenuName("Logout")
 class LogoutPage @Inject constructor(template: Template, webInterface: WebInterface):
                LoggedInPage("logout.html", template, "Page.Logout.Title", webInterface) {
 
index f3bed3c..ef40e55 100644 (file)
@@ -3,6 +3,7 @@ package net.pterodactylus.sone.web.pages
 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 org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.equalTo
 import org.hamcrest.Matchers.notNullValue
@@ -74,4 +75,9 @@ class LogoutPageTest: WebPageTest(::LogoutPage) {
            assertThat(baseInjector.getInstance<LogoutPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("Logout"))
+       }
+
 }