https://kotlinlang.org logo
#coroutines
Title
# coroutines
g

groostav

07/15/2019, 8:54 PM
has anybody got a good description of how mockito (and or some nice extension for it) can/should/will handle mocking `suspend fun`s? I remember mockito 1.X (1.95?) simply wouldn't, but now I notice that I've got 2.23 on my classpath. Does that automagically handle mocking suspend-funs for me?
s

streetsofboston

07/15/2019, 9:12 PM
It should be able to handle them. Not sure how, though. For Kotlin-only projects, we moved to use MockK instead of Mockito. Dealing with suspend funs is easy there (since the MockK is specifically designed for Kotlin).
b

bdawg.io

07/15/2019, 9:37 PM
+1 for MockK
m

Marko Mitic

07/15/2019, 9:41 PM
+2 for Mockk
g

groostav

07/15/2019, 9:52 PM
I'm trying to reduce the amount of mocking we do, not add more mocking libs..
s

streetsofboston

07/15/2019, 9:56 PM
We’re not advocating for adding one. We’re advocating for replacing one 😄
☝️ 8
m

Marko Mitic

07/15/2019, 10:48 PM
If you want to reduce your mocking code, mockk is the right way to go
c

christophsturm

07/16/2019, 11:33 AM
mockk is great but recent mockito version can mock suspend functions fine.
5 Views