Dave Leeds
03/27/2020, 8:29 PMcoEvery { httpClient.hint(MyPayload::class).get<MyPayload>(any<String>()) }.returns(examplePayload)
But this fails with a class cast exception:
MyPayload cannot be cast to io.ktor.client.call.HttpClientCall
I suspect the reason for this is that the entire call stack between the test and HttpStatement.executeUnsafe()
is made up of inline
functions. I tried to mock httpClient.execute()
since that’s ultimately what gets invoked, but that’s marked as @InternalAPI
. Any ideas?russhwolf
03/27/2020, 8:47 PMMockEngine
where you can control what responses it serves.Dave Leeds
03/27/2020, 9:19 PMrusshwolf
03/27/2020, 9:30 PMDave Leeds
03/27/2020, 9:36 PM