KtorTestApplication

abstract class KtorTestApplication(scope: InjectionScope, val appName: String?) : TegralService, ClientProvider

A component that manages KtorApplication components and provides test facilities over them.

Note: in a test environment, you must add with noService to your KtorApplication declaration, like so:

put(::MyKtorApplication) with noService

This is because integration testing environments perform start sequences like regular environments, yet we do not generally want to actually start a Ktor server.

Inheritors

Constructors

Link copied to clipboard
constructor(scope: InjectionScope, appName: String?)

Properties

Link copied to clipboard

The name of the KtorApplication this instance is for.

Link copied to clipboard
open override val client: HttpClient

Functions

Link copied to clipboard

A function called for every created client for the application.

Link copied to clipboard
open override fun createClient(block: HttpClientConfig<out HttpClientEngineConfig>.() -> Unit): HttpClient
Link copied to clipboard
open suspend override fun start()
Link copied to clipboard
open suspend override fun stop()