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.

Constructors

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

Functions

Link copied to clipboard
abstract fun KtorTestClientConfig.configureClient()

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()

Properties

Link copied to clipboard
val appName: String?

The name of the KtorApplication this instance is for.

Link copied to clipboard
open override val client: HttpClient

Inheritors

Link copied to clipboard