-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with testing post route with body #55
Comments
I'll look at it later today if i have time. Also be careful with authenticated routes, the definitions could clash, this was the reason i originally didn't create these variants... |
Oh right, something similar happened to someone else also, make sure that the content type is specified in the tests, the routes are defined on specific content types to allow handling of multiple content types on the same route. |
Setting the content type resolved the issue and now all the test cases pass. So I'll close this issue. I'll take a look at the auth routes. If the generics does cause a problem, would you be open to something like
looks better than
|
The plan is to eventually transition to an injection based route configuration #10 |
I wanted to create a PR that would allow for not using
Unit
when there are no route params (should be ready soon). However, when I was writing some unit test cases for the new code, I ran into a weird issue with the post route not being handled when the body was specified. What makes this weird is that running the same code works fine when standing up the server and sending real post requests.This commit has a minimal server that shows the post working (ktor only, post route with
Any
for body, post route with actually specifying body type) and a unit test cases that should represent those same three cases, buttestPost_bodyType_expectedBodyAndResponse
fails.Can you take a look? It is possible that I am missing something. I don't know enough about the
ktor
internals to track down where the request is being rejected. And it is odd that only the test application fails.The text was updated successfully, but these errors were encountered: