Join Slack
Powered by
I need to mock multiple http calls for integration...
# ktor
j
João Gabriel Zó
02/01/2024, 3:48 PM
I need to mock multiple http calls for integration tests. What’s the best way to do it? I’m using Ktor + Kotest
c
Casey Brooks
02/01/2024, 3:57 PM
There’s a mock engine available, which simulates the network calls without actually hitting the network
https://ktor.io/docs/http-client-testing.html
a
AdamW
02/01/2024, 3:58 PM
Depending on how you’ve built your server and how it’s used in tests, you can use the
externalServices
block in a
ApplicationTestBuilder
or pass around a client with
MockEngine
installed.
👍 1
j
João Gabriel Zó
02/01/2024, 4:53 PM
Got it working with my app, thanks guys!
21
Views
Open in Slack
Previous
Next