WebIntegrationTestContext

Context within which integration tests are run.

This is similar to any regular Tegral DI test environment (as in, you can get, put elements, etc.), with the addition of the ability to retrieve HTTP clients to send requests to Ktor applications present in the environment.

Constructors

Link copied to clipboard
fun WebIntegrationTestContext(env: UnsafeMutableEnvironment)

Functions

Link copied to clipboard
open override fun client(appName: String?): HttpClient

Retrieves a HttpClient with default configurations for the KtorTestApplication with the given name.

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

open override fun createClient(appName: String?, block: HttpClientConfig<out HttpClientEngineConfig>.() -> Unit): HttpClient

Retrieves a HttpClient with default configurations and the configurations provided in the given block for the KtorTestApplication with the given name.

Link copied to clipboard
open override fun <T : Any> createInjector(identifier: Identifier<T>, onInjection: (T) -> Unit): Injector<T>
Link copied to clipboard
open override fun <T : Any> get(identifier: Identifier<T>): T
Link copied to clipboard
open override fun getAllIdentifiers(): Sequence<Identifier<*>>
Link copied to clipboard
open override fun <T : Any> getOrNull(identifier: Identifier<T>): T?
Link copied to clipboard
open override fun <T : Any> getResolverOrNull(identifier: Identifier<T>): IdentifierResolver<T>?
Link copied to clipboard
open override fun <T : Any> put(declaration: Declaration<T>)

Properties

Link copied to clipboard
open override val client: HttpClient
Link copied to clipboard
open override val components: Map<Identifier<*>, IdentifierResolver<*>>
Link copied to clipboard
open override val metaEnvironment: InjectionEnvironment