ktor
ktor copied to clipboard
What's the correct pattern for testing authenticated routes?
What would be a good pattern to test authenticated routes? Is it ok to generate real credentials? If not, how can you pass the authorization?
Any news?
Don't know if it is correct way, but what I do.
For tests I am using testcontainers and kotest. On startup of testapplication I am creating dummy user( which will use real endpoint to login - function which cqn be used on repeat Some common functions) and then i am making other requests with real token. Don't see any problem with it
Don't know if it is correct way, but what I do.
For tests I am using testcontainers and kotest. On startup of testapplication I am creating dummy user( which will use real endpoint to login - function which cqn be used on repeat Some common functions) and then i am making other requests with real token. Don't see any problem with it
I've been doing the same, minus kotest, this hasn't had an answer in a long time, I guess we might never receive an official way.