lundi 22 janvier 2018

Spock with Mockito testing Kotlin classes

I have some tests written in Spock which covers my Java code. Now I migrate to Kotlin and the problem is i cannot mock final classes so i decide to use Mockito plugin described here: https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#unmockable

The question is do I need to replace every '_' '>>' with Mockitos' any(), anyString(), when(), then() etc? I tried to just mock final classes using Mockito but it seems not work.

If i have to replace what the advantage is for using Spock testing framework in this case? Maybe i should remove it and stay with Mockito only?

Aucun commentaire:

Enregistrer un commentaire