Chico
04/13/2022, 7:15 PMDictKey.get call, but I'm having this problem Type mismatch: inferred type is DictKey but MockKMatcherScope.DynamicCall was expected
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..
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 PMMattia Tommasone
04/13/2022, 7:48 PMDictKey.get
static? If so, you have to use mockkStatic(DicktKey::class)
Chico
04/13/2022, 7:51 PMChico
04/13/2022, 7:51 PMPedro Francisco de Sousa Neto
04/13/2022, 9:10 PMChico
04/13/2022, 10:13 PM