ApplicationTestBuilder

A builder for a test that uses TestApplication.

Constructors

Link copied to clipboard
fun ApplicationTestBuilder()

Functions

Link copied to clipboard
fun application(block: <ERROR CLASS>.() -> Unit)

Adds a module to TestApplication.

Link copied to clipboard
open override fun createClient(block: <ERROR CLASS><out <ERROR CLASS>>.() -> Unit): <ERROR CLASS>

Creates a client with a custom configuration. For example, to send JSON data in a test POST/PUT request, you can install the ContentNegotiation plugin:

Link copied to clipboard
fun environment(block: <ERROR CLASS>.() -> Unit)

Builds an environment using block.

Link copied to clipboard
fun externalServices(block: ExternalServicesBuilder.() -> Unit)

Builds mocks for external services using ExternalServicesBuilder.

Link copied to clipboard
fun <P, B : Any, F : Any> install(plugin: <ERROR CLASS><P, B, F>, configure: B.() -> Unit = {})

Installs a plugin into TestApplication

Link copied to clipboard
fun routing(configuration: <ERROR CLASS>.() -> Unit)

Installs routing into TestApplication

Properties

Link copied to clipboard
open override val client: <ERROR CLASS>

Returns a client with the default configuration.