Convert bookmark page test to use new web page test base
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 20 Jun 2017 12:36:21 +0000 (14:36 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 20 Jun 2017 12:36:21 +0000 (14:36 +0200)
src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarkPageTest.kt

index 0fe428e..c03706b 100644 (file)
@@ -13,10 +13,7 @@ import org.mockito.Mockito.verify
 /**
  * Unit test for [BookmarkPage].
  */
-class BookmarkPageTest : WebPageTest() {
-
-       private val page = BookmarkPage(template, webInterface)
-       override fun getPage() = page
+class BookmarkPageTest: WebPageTest2(::BookmarkPage) {
 
        @Test
        fun `path is set correctly`() {
@@ -25,8 +22,9 @@ class BookmarkPageTest : WebPageTest() {
 
        @Test
        fun `get request does not bookmark anything and does not redirect`() {
-               page.processTemplate(freenetRequest, templateContext)
-               verify(core, never()).bookmarkPost(any())
+               verifyNoRedirect {
+                       verify(core, never()).bookmarkPost(any())
+               }
        }
 
        private fun setupBookmarkRequest() {