MockEngine

class MockEngine(config: MockEngineConfig) : HttpClientEngineBase

HttpClientEngine for writing tests without network.

Constructors

Link copied to clipboard
fun MockEngine(config: MockEngineConfig)

Types

Link copied to clipboard
object Companion : HttpClientEngineFactory<MockEngineConfig>

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun execute(data: HttpRequestData): HttpResponseData
Link copied to clipboard
open fun install(client: HttpClient)

Properties

Link copied to clipboard
open override val config: MockEngineConfig
Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
open override val dispatcher: CoroutineDispatcher
Link copied to clipboard
val requestHistory: List<HttpRequestData>

History of executed requests.

Link copied to clipboard
val responseHistory: List<HttpResponseData>

History of sent responses.

Link copied to clipboard
open override val supportedCapabilities: Set<HttpClientEngineCapability<out Any>>