Hello guys, I have this exemple
the DictKey.get will call and external api, then I’m trying to mock
DictKey.get call, but I'm having this problem Type mismatch: inferred type is DictKey but MockKMatcherScope.DynamicCall was expected
Copy code
class A {
fun callExternalApi(key: String) {
return DictKey.get(key)
}
}
But DictKey.get return an instance Of DictKey(….) I would like to stub it
What I’m doing..
Copy code
val key = "my-key"
val mockDt = mockk<DictKey>()
every { mockDt.get(key) } returns what I have to put here?
val retruanCallExternalApi = A().callExternalApi(key)
Chico
04/13/2022, 7:16 PM
I tried return and mock of DictKey as well, but I had that problem MockKMatcher…