From b164c251efbe9be8108ad3a1d4009797d3507237 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 19 Jun 2017 23:33:53 +0200 Subject: [PATCH] Turn web page test base into class that can be used with composition --- .../pterodactylus/sone/web/pages/WebPageTest2.kt | 59 ++++++++++++---------- 1 file changed, 33 insertions(+), 26 deletions(-) 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 bf328a7..5ec3ead 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest2.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest2.kt @@ -23,6 +23,7 @@ import net.pterodactylus.util.template.Template import net.pterodactylus.util.template.TemplateContext import net.pterodactylus.util.web.Method import net.pterodactylus.util.web.Method.GET +import net.pterodactylus.util.web.Response import org.junit.Assert.fail import org.junit.Before import org.mockito.ArgumentMatchers.anyBoolean @@ -30,6 +31,7 @@ import org.mockito.ArgumentMatchers.anyInt import org.mockito.ArgumentMatchers.anyLong import org.mockito.ArgumentMatchers.anyString import org.mockito.ArgumentMatchers.eq +import java.io.ByteArrayOutputStream import java.net.URI import java.nio.charset.Charset import kotlin.text.Charsets.UTF_8 @@ -37,22 +39,24 @@ import kotlin.text.Charsets.UTF_8 /** * Base class for web page tests. */ -abstract class WebPageTest2(pageSupplier: (Template, WebInterface) -> SoneTemplatePage) { - - protected val currentSone = mock() - protected val template = mock