Maybe a very easy question, but I couldn't find it...
# ktor
t
Maybe a very easy question, but I couldn't find it: I want to create a test in Ktor-client that simulates that the httpClient does not have an connection. How can I do that?
k
You can use
MockEngine
like that:
Copy code
HttpClient(MockEngine) {
    engine {
        addHandler {
            throw IOException("")
        }
    }
}
👍🏻 1
t
haha, thank! I was indeed thinking way to complicated...