TestEngine
fun TestEngine(name: String = "test", roundTripImpl: suspend (ExecutionContext, HttpRequest) -> HttpCall = { _, request ->
val resp = HttpResponse(HttpStatusCode.OK, Headers.Empty, HttpBody.Empty)
val now = Instant.now()
HttpCall(request, resp, now, now)
}): HttpClientEngine
A simplistic HttpClientEngine suitable for integration testing. This engine yields a hardcoded HttpClientEngineConfig.Default for its configuration.
Parameters
name
The name of this engine, which is used in constructing a coroutine context. By default, the name is "test".
roundTripImpl
A lambda which specifies the result of a call to roundTrip. By default, this returns an HTTP 200 response with no headers and no body.