From: David ‘Bombe’ Roden Date: Tue, 30 Jul 2019 07:57:52 +0000 (+0200) Subject: ✅ Fix initialization of metrics page test X-Git-Tag: v81^2~160 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=90e43deb171e0d178feac3c25d398a9dbe808768;p=Sone.git ✅ Fix initialization of metrics page test --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/MetricsPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/MetricsPageTest.kt index ca69e66..0565612 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/MetricsPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/MetricsPageTest.kt @@ -25,11 +25,10 @@ import org.hamcrest.MatcherAssert.* import org.hamcrest.Matchers.* import kotlin.test.* -class MetricsPageTest : WebPageTest({ webInterface, loaders, templateRenderer -> MetricsPage(webInterface, loaders, templateRenderer, metricRegistry) }) { +class MetricsPageTest : WebPageTest() { - companion object { - val metricRegistry = MetricRegistry() - } + private val metricRegistry = MetricRegistry() + override val page by lazy { MetricsPage(webInterface, loaders, templateRenderer, metricRegistry) } @Test fun `page returns correct path`() { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt index f51bece..61d1a03 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt @@ -43,7 +43,7 @@ open class WebPageTest(pageSupplier: (WebInterface, Loaders, TemplateRenderer) - val l10n = webInterface.l10n!! val sessionManager = mock() - val page by lazy { pageSupplier(webInterface, loaders, templateRenderer) } + open val page by lazy { pageSupplier(webInterface, loaders, templateRenderer) } val httpRequest = mock() val freenetRequest = mock()