JVM Version, Operating System and Relevant Context
openjdk 11
Feedback
Hello,
First of all nice work with your framework. I have one question though: i use status pages to handle some custom content for some specific statuses. It works when i run an actual Netty engine.
Now i do some testing with the test application engine, and i notice that status entries in status pages behave weirdly and my tests fail.
// TODO why do we need this ?
// application.intercept(ApplicationCallPipeline.Call) {
// call.respond(HttpStatusCode.NotFound)
// }
describe("making an unknown route request") {
with(handleRequest(HttpMethod.Get, "/unknown-route")) {
it("responds with expected default error message") {
response.status() `should equal` HttpStatusCode.NotFound
// response status is null ??
}
}
Now this test passes when i uncomment those lines, but why do i need to do it this way ? shouldn'it be handled by my actual application logic ?
I can uncomment those lines for 404 testing stuff but it annoys me to do so for 415 testing code that fails in similar way.
Can you please advise ?
That was a buggy behavior of the test application engine and the StatusPages feature interaction. You can observe the expected (without those lines) behavior with Ktor 1.5.3.
Ktor Version
1.1.4
Ktor Engine Used(client or server and name)
Test engine / Netty
JVM Version, Operating System and Relevant Context
openjdk 11
Feedback
Hello, First of all nice work with your framework. I have one question though: i use status pages to handle some custom content for some specific statuses. It works when i run an actual Netty engine. Now i do some testing with the test application engine, and i notice that status entries in status pages behave weirdly and my tests fail.
Example:
The test is simple
Now this test passes when i uncomment those lines, but why do i need to do it this way ? shouldn'it be handled by my actual application logic ? I can uncomment those lines for 404 testing stuff but it annoys me to do so for 415 testing code that fails in similar way. Can you please advise ?