Hexworks / zircon

Zircon is an extensible and user-friendly, multiplatform tile engine.
https://hexworks.org/projects/zircon/
Apache License 2.0
755 stars 138 forks source link

Mockito update/enhancements #384

Closed nanodeath closed 3 years ago

nanodeath commented 3 years ago

This is an admin task, but...Zircon's using Mockito 1.x (1.10.19), which was last updated in 2014. Mockito 3.x is available now. Mockito 2.x had a lot of enhancements, but the main thing of interest to me is strict stubs, which makes for higher-quality tests. We also don't seem to be leveraging the Mockito-kotlin module everywhere.

So:

Also, FWIW, Mockito is used very little in this codebase; just UIEventToComponentDispatcherTest and DefaultAnimationRunnerTest, so this shouldn't be a big change.

Baret commented 3 years ago

As we are in a kotlin project I'd like to suggest to switch to MockK entirely. When you need to touch all tests anyways, it shouldn't be much more work I guess.

My experience with mockk so far is that is a charm to work with and much much better than mockito.

nanodeath commented 3 years ago

mockito-kotlin works fine except for things like coroutines or objects, which we're not making heavy use of. I agree that mockk is better than mockito-kotlin, but it's also more effort to switch.