Queue
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(source)
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.
Most useful if you want to create an io.ktor.client.HttpClient instance before your test begins, and need to specify behaviour on a per-test basis.
Constructors
Link copied to clipboard
constructor(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
})
Properties
Functions
Link copied to clipboard
Appends a new MockRequestHandler, to be called/removed after any previous handlers have been consumed.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Just a syntactic shortcut to enqueue.