TestApplicationResponse

class TestApplicationResponse(call: TestApplicationCall, readResponse: Boolean) : CoroutineScope

A test call response received from a server.

Constructors

Link copied to clipboard
fun TestApplicationResponse(call: TestApplicationCall, readResponse: Boolean = false)

Functions

Link copied to clipboard
fun awaitWebSocket(durationMillis: Long)

Waits for a websocket session completion.

Link copied to clipboard
fun contentChannel(): <ERROR CLASS>?

Gets a response body content channel.

Link copied to clipboard
open suspend fun respondOutgoingContent(content: <ERROR CLASS>)
Link copied to clipboard
open suspend fun respondUpgrade(upgrade: <ERROR CLASS>)
Link copied to clipboard
open suspend fun responseChannel(): <ERROR CLASS>
Link copied to clipboard
open fun setStatus(statusCode: <ERROR CLASS>)
Link copied to clipboard
fun websocketChannel(): <ERROR CLASS>?

A websocket session's channel.

Properties

Link copied to clipboard
var byteContent: ByteArray?
Link copied to clipboard
val content: String?

Gets a response body text content. Could be blocking. Remains null until response appears.

Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
open val headers: <ERROR CLASS>

Extensions

Link copied to clipboard
fun TestApplicationResponse.awaitWebSocket(duration: Duration)

Wait for websocket session completion

Link copied to clipboard
fun TestApplicationResponse.contentType(): <ERROR CLASS>

Returns a parsed content type from a test response.