Has anyone here used the ktorClient together with ...
# ktor
g
Has anyone here used the ktorClient together with mockk to verify? What I am doing right now is to setup a 200-always mock:
Copy code
private fun createMockedHttpClient(): HttpClient {
    return HttpClient(MockEngine) {
        engine {
            addHandler { request ->
                respond("hej")
            }
        }
    }
}
and then I try to coVerify (a function from mockk) that calls were made towards the mock
Copy code
coVerify(exactly = 10) { <http://httpClient.post|httpClient.post>("<http://localhost:8081>") }
but what I get is
Missing calls inside verify { ... } block.
I might've rubber ducked myself a bit on this, if I do this instead
Copy code
coVerify(exactly = 10) { <http://httpClient.post|httpClient.post>("<http://localhost:8081>") { any() } }
I don't get that issue but I do get
Copy code
Failed matching mocking signature for

left matchers: [any()]
io.mockk.MockKException: Failed matching mocking signature for