From: David ‘Bombe’ Roden Date: Sun, 18 Jun 2017 21:45:17 +0000 (+0200) Subject: Convert sone template page test to use new web page test base X-Git-Tag: 0.9.7^2~152 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ce75a1d1a837cd33046c0da5098240c3629f7df7;p=Sone.git Convert sone template page test to use new web page test base --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/SoneTemplatePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/SoneTemplatePageTest.kt index 4cef5b0..c872b08 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/SoneTemplatePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/SoneTemplatePageTest.kt @@ -21,10 +21,7 @@ import org.mockito.Mockito.verify /** * Unit test for [SoneTemplatePage]. */ -class SoneTemplatePageTest : WebPageTest() { - - private val preferences by lazy { core.preferences!! } - private val page = object : SoneTemplatePage("path.html", template, webInterface, true) {} +class SoneTemplatePageTest: WebPageTest2({ template, webInterface -> object : SoneTemplatePage("path.html", template, webInterface, true) {}}) { @Test fun `current sone is retrieved from web interface`() { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest2.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest2.kt index b04fc4b..6c4372d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest2.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest2.kt @@ -25,6 +25,7 @@ import org.mockito.ArgumentMatchers.anyInt import org.mockito.ArgumentMatchers.anyLong import org.mockito.ArgumentMatchers.anyString import org.mockito.ArgumentMatchers.eq +import java.net.URI import java.nio.charset.Charset import kotlin.text.Charsets.UTF_8 @@ -34,19 +35,20 @@ import kotlin.text.Charsets.UTF_8 abstract class WebPageTest2(pageSupplier: (Template, WebInterface) -> SoneTemplatePage) { protected val currentSone = mock() - private val template = mock