https://kotlinlang.org logo
#ktor
Title
# ktor
c

christophsturm

04/14/2021, 9:08 PM
can someone explain why this test fails:
Copy code
val context = describe("ktor") {
        it("routing works") {
            val server = TestApplicationEngine(environment = createTestEnvironment {
                module {
                    routing {
                        route("/x") {
                            route("/y") {
                                get {}
                            }

                        }
                    }

                }
            }) {}.apply { start() }

            expectThat(server.handleRequest(HttpMethod.Get, "/x/y").response.status()).isNotNull().get { isSuccess() }.isTrue()
        }
    }
It produces a 404, the route is not found
d

dave08

04/16/2021, 8:11 AM
I think you need to call call.respond()...
👍 1
🙏 1
c

christophsturm

04/16/2021, 8:32 AM
you are right, thanks. is that documented anywhere? i would expect to see a 203 result or an internal server error, but no 404