tim
09/01/2021, 12:58 PMobject Singleton {
val client = SomeClient()
fun foo() {
// calls to me are mocked in my unit test
client.bar()
}
}
When I mock calls to foo
with mockkObject
using every
the SomeClient() constructor is still called. So do I also need to mock SomeClient, or is there a way I can mockkAll of Singleton or perhaps just intercept calls to client?Mattia Tommasone
09/01/2021, 12:59 PMSomeClient
, doing something like
every { anyConstructed<SomeClient>().bar() }
does this make sense to you?tim
09/01/2021, 1:19 PM