MockEngine

HttpClientEngine for writing tests without network.

Report a problem

Inheritors

Constructors

Link copied to clipboard
constructor(config: MockEngineConfig)

Types

Link copied to clipboard
Link copied to clipboard
class Queue(val config: MockEngineConfig = MockEngineConfig().apply { // Every time a handler is called, it gets disposed. So make sure enough handlers are registered for // requests you intend to make! reuseHandlers = false }) : MockEngine

Create a MockEngine with an empty MockEngineConfig - meaning no request handlers are registered by default. This means that you need to separately call enqueue to add one or more handlers before making any requests.

Properties

Link copied to clipboard
open override val config: MockEngineConfig
Link copied to clipboard
Link copied to clipboard
open override val dispatcher: CoroutineDispatcher
Link copied to clipboard

History of executed requests.

Link copied to clipboard

History of sent responses.

Link copied to clipboard

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)