package net.pterodactylus.sone.web.pages import com.google.common.eventbus.EventBus import freenet.clients.http.ToadletContext import freenet.support.SimpleReadOnlyArrayBucket import freenet.support.api.HTTPRequest import freenet.support.api.HTTPUploadedFile import net.pterodactylus.sone.core.Preferences import net.pterodactylus.sone.data.Album import net.pterodactylus.sone.data.Image import net.pterodactylus.sone.data.Post import net.pterodactylus.sone.data.PostReply import net.pterodactylus.sone.data.Sone import net.pterodactylus.sone.data.TemporaryImage import net.pterodactylus.sone.freenet.wot.OwnIdentity import net.pterodactylus.sone.test.deepMock import net.pterodactylus.sone.test.get import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.utils.asList import net.pterodactylus.sone.utils.asOptional import net.pterodactylus.sone.web.WebInterface import net.pterodactylus.sone.web.page.FreenetRequest import net.pterodactylus.sone.web.page.FreenetTemplatePage.RedirectException import net.pterodactylus.util.notify.Notification 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.mockito.ArgumentMatchers.anyBoolean 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 /** * Base class for web page tests. */ open class WebPageTest(pageSupplier: (Template, WebInterface) -> SoneTemplatePage = { _, _ -> mock() }) { val currentSone = mock() val template = mock