public class TestApplicationEngine
ktor test engine that provides way to simulate application calls to existing application module(s) without actual HTTP connection
| Modifier and Type | Class and Description |
|---|---|
static class |
TestApplicationEngine.Configuration
Test application engine configuration
|
| Constructor and Description |
|---|
TestApplicationEngine(io.ktor.server.engine.ApplicationEngineEnvironment environment,
kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationEngine.Configuration,kotlin.Unit> configure)
ktor test engine that provides way to simulate application calls to existing application module(s)
without actual HTTP connection
|
TestApplicationEngine()
ktor test engine that provides way to simulate application calls to existing application module(s)
without actual HTTP connection
|
| Modifier and Type | Method and Description |
|---|---|
TestApplicationCall |
createCall(boolean readResponse,
kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup)
Creates an instance of test call but doesn't start request processing
|
NonExistentClass |
getCoroutineContext() |
TestApplicationCall |
handleRequest(kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup)
Make a test request
|
TestApplicationCall |
handleWebSocket(java.lang.String uri,
kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup)
Make a test request that setup a websocket session and wait for completion
|
TestApplicationCall |
handleWebSocketConversation(java.lang.String uri,
kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup,
kotlin.jvm.functions.Function4<? super io.ktor.server.testing.TestApplicationCall,? super kotlinx.coroutines.channels.ReceiveChannel<? extends io.ktor.http.cio.websocket.Frame>,? super kotlinx.coroutines.channels.SendChannel<? super io.ktor.http.cio.websocket.Frame>,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> callback)
Make a test request that setup a websocket session and invoke callback function
that does conversation with server
|
void |
hookRequests(kotlin.jvm.functions.Function2<? super io.ktor.server.testing.TestApplicationRequest,? super kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit>,kotlin.Unit> processRequest,
kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationCall,kotlin.Unit> processResponse,
kotlin.jvm.functions.Function0<kotlin.Unit> block)
Install a hook for test requests
|
io.ktor.server.engine.ApplicationEngine |
start(boolean wait) |
void |
stop(long gracePeriod,
long timeout,
java.util.concurrent.TimeUnit timeUnit) |
public TestApplicationEngine(io.ktor.server.engine.ApplicationEngineEnvironment environment,
kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationEngine.Configuration,kotlin.Unit> configure)
ktor test engine that provides way to simulate application calls to existing application module(s) without actual HTTP connection
public TestApplicationEngine()
ktor test engine that provides way to simulate application calls to existing application module(s) without actual HTTP connection
public NonExistentClass getCoroutineContext()
public io.ktor.server.engine.ApplicationEngine start(boolean wait)
public void stop(long gracePeriod,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
public void hookRequests(kotlin.jvm.functions.Function2<? super io.ktor.server.testing.TestApplicationRequest,? super kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit>,kotlin.Unit> processRequest,
kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationCall,kotlin.Unit> processResponse,
kotlin.jvm.functions.Function0<kotlin.Unit> block)
Install a hook for test requests
public TestApplicationCall handleRequest(kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup)
Make a test request
public TestApplicationCall handleWebSocket(java.lang.String uri, kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup)
Make a test request that setup a websocket session and wait for completion
public TestApplicationCall handleWebSocketConversation(java.lang.String uri, kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup, kotlin.jvm.functions.Function4<? super io.ktor.server.testing.TestApplicationCall,? super kotlinx.coroutines.channels.ReceiveChannel<? extends io.ktor.http.cio.websocket.Frame>,? super kotlinx.coroutines.channels.SendChannel<? super io.ktor.http.cio.websocket.Frame>,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> callback)
Make a test request that setup a websocket session and invoke callback function that does conversation with server
public TestApplicationCall createCall(boolean readResponse, kotlin.jvm.functions.Function1<? super io.ktor.server.testing.TestApplicationRequest,kotlin.Unit> setup)
Creates an instance of test call but doesn't start request processing