TestApplicationResponse

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

Represents test call response received from server

Constructors

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

Functions

Link copied to clipboard
fun awaitWebSocket(duration: Duration)

fun awaitWebSocket(durationMillis: Long)

Wait for websocket session completion

Link copied to clipboard
fun contentChannel(): ByteReadChannel?

Response body content channel

Link copied to clipboard
suspend fun flush()

Await for response job completion

Link copied to clipboard
open override fun push(builder: ResponsePushBuilder)
Link copied to clipboard
open override fun status(): HttpStatusCode?
open override fun status(value: HttpStatusCode)
Link copied to clipboard
fun websocketChannel(): ByteReadChannel?

Websocket session's channel

Properties

Link copied to clipboard
var byteContent: ByteArray? = null

Response body byte content. Could be blocking. Remains null until response appears.

Link copied to clipboard
override val call: ApplicationCall
Link copied to clipboard
val content: String?

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

Link copied to clipboard
open override val cookies: ResponseCookies
Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
open override val headers: ResponseHeaders
Link copied to clipboard
override val pipeline: ApplicationSendPipeline

Extensions

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

Wait for websocket session completion

Link copied to clipboard
fun TestApplicationResponse.contentType(): ContentType

Return parsed content type from the test response