Open neisip opened 4 years ago
There is a available out of the box now:
mockkStatic("io.github.rybalkinsd.kohttp.dsl.HttpGetDslKt")
every { httpGet(any(), any()) } returns Response.Builder()....build()
Need to add separate module, which will invoke all the static mocks initialisation. Also need some sugar
It would be really nice to have ability to somehow swap defaultHttpClient: okhttp3.Call.Factory with Mock Entity in tests. For now current implementation of functions like httpGet {} can be only tested by using MockWebServer from okhttp or you have to inject okhttp3.Call.Factory manually.
Ideally i would like to have integration with mockk, because it's designated mocking framework for kotlin.
Example: