From: David ‘Bombe’ Roden Date: Mon, 19 Jun 2017 21:33:53 +0000 (+0200) Subject: Turn web page test base into class that can be used with composition X-Git-Tag: 0.9.7^2~135 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b164c251efbe9be8108ad3a1d4009797d3507237;p=Sone.git Turn web page test base into class that can be used with composition --- 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