Richard Schielek
fun Application.configureRouting() { routing { get("/") { error("Something went wrong") } } }
class ApplicationTest { @Test fun testRoot() = testApplication { application { configureRouting() } val response = client.get("/") // java.lang.IllegalStateException: Something went wrong assertEquals(HttpStatusCode.InternalServerError, response.status) } }
Rustam Siniukov
ktor.test.throwOnException=false
testApplication { environment { config = MapApplicationConfig("ktor.test.throwOnException" to "false") } .... }
A modern programming language that makes developers happier.