✨ Annotate CreateSonePage with MenuName
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 09:41:00 +0000 (11:41 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 09:41:00 +0000 (11:41 +0200)
src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt
src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt

index 78f981c..3abb927 100644 (file)
@@ -14,6 +14,7 @@ import javax.inject.Inject
 /**
  * The “create Sone” page lets the user create a new Sone.
  */
 /**
  * The “create Sone” page lets the user create a new Sone.
  */
+@MenuName("CreateSone")
 class CreateSonePage @Inject constructor(template: Template, webInterface: WebInterface):
                SoneTemplatePage("createSone.html", webInterface, template, "Page.CreateSone.Title") {
 
 class CreateSonePage @Inject constructor(template: Template, webInterface: WebInterface):
                SoneTemplatePage("createSone.html", webInterface, template, "Page.CreateSone.Title") {
 
index 547347a..9b5f983 100644 (file)
@@ -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.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.contains
 import net.pterodactylus.util.web.Method.POST
 import org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.contains
@@ -150,4 +151,9 @@ class CreateSonePageTest : WebPageTest(::CreateSonePage) {
                assertThat(baseInjector.getInstance<CreateSonePage>(), notNullValue())
        }
 
                assertThat(baseInjector.getInstance<CreateSonePage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with the correct menuname`() {
+           assertThat(page.menuName, equalTo("CreateSone"))
+       }
+
 }
 }