https://kotlinlang.org logo
#ktor
Title
# ktor
r

Rekha

08/01/2022, 7:05 AM
hi, i am a newbie to ktor. We are using kotr for android and trying to write the unit test for ktor network call with okhttp. how to mock the client enginfe for unit test? Thanks
a

Aleksei Tirman [JB]

08/01/2022, 12:14 PM
You can use the MockEngine to prevent making network calls by a client.
r

Rekha

08/01/2022, 7:01 PM
Thats not working for me…. Are there any examples?
a

Aleksei Tirman [JB]

08/02/2022, 7:41 AM
Here is an example. What exactly isn’t working for you?
3 Views