From 4fa7cbf1a4014897563cce41a338bb2925183c0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 May 2019 12:07:13 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20LoginPage=20with=20MenuNa?= =?utf8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt | 1 + src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) 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 20251c0..96e8b27 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt @@ -13,6 +13,7 @@ import javax.inject.Inject /** * The login page lets the user log in. */ +@MenuName("Login") class LoginPage @Inject constructor(template: Template, webInterface: WebInterface): SoneTemplatePage("login.html", webInterface, template, "Page.Login.Title") { 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 9d29a55..794e68b 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt @@ -8,6 +8,7 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.thenReturnMock 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.contains @@ -146,4 +147,9 @@ class LoginPageTest: WebPageTest(::LoginPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("Login")) + } + } -- 2.7.4