Hey everyone, I have a question about unit testing...
# ktor
p
Hey everyone, I have a question about unit testing ktor-server and HTTPS. I read https://ktor.io/docs/testing.html#https, which makes it seem possible to test HTTPS in unit tests. Is this performing an actual HTTPS request, including the whole TLS handshake? I thought that unit testing with
testApplication
does not perform real HTTP(S) requests. Does this mean I should use end-to-end tests; such as: https://ktor.io/docs/testing.html#end-to-end What I try to achieve is make sure that my HTTPS request handling works, and that my
sslConnector
is setup correctly. Thanks in advance!
a
Is this performing an actual HTTPS request, including the whole TLS handshake?
No. The
testApplication
doesn't use the real network. So yes, you can verify the secure connection by writing the end-to-end tests.
👍 1
p
Great thanks a lot for your reply! 🙌