johnaqel
06/30/2021, 12:34 AMcrummy
06/30/2021, 1:26 AMAleksei Tirman [JB]
06/30/2021, 11:49 AMimplementation("io.ktor:ktor-server-test-host:$ktor_version")
dependency:
embeddedServer(Netty, port = 9090) {
environment.monitor.subscribe(ApplicationStarted) { app ->
val routing = app.feature(Routing)
val call = TestApplicationCall(app, coroutineContext = EmptyCoroutineContext)
// The request we want to probe
call.request.method = HttpMethod.Get
call.request.uri = "/some"
val context = RoutingResolveContext(routing, call, emptyList())
if (context.resolve() is RoutingResolveResult.Success) {
println("Does exist")
}
}
routing {
get("/some") {
call.respondText { "Hello" }
}
}
}.start(wait = true)
johnaqel
06/30/2021, 10:10 PM