logoalt Hacker News

t-writescodeyesterday at 10:55 PM4 repliesview on HN

Wow, there's a lot of anger in some of these posts.

I've been using Mockito for about 4 years, all in Kotlin. I always found it to be "plenty good" for like 99% of the cases I needed it; and things more complicated or confusing or messy were usually my fault (poor separation of concerns, etc).

I regularly found it quite helpful in both its spy() and mock() functionality.

I never found it meaningfully more or less useful than MockK, though I have heard MockK is the "one that's better for Kotlin". It's mostly just vocabulary changes for me, the user.

I'm going to have to monitor Mockito's future and see if I'll need to swap to MockK at some point if Mockito becomes unmaintained.


Replies

gerdesjyesterday at 11:46 PM

"Wow, there's a lot of anger in some of these posts."

If I was OP I'd retire happy knowing that a very thankless job is well done! Given what it does: the more outrage the better. Projects like Mockito call out the lazy and indolent for whom they are and the hissing and spitting in return can simply be laughed at.

10 years this bloke has given his time and effort to help people. He states: nearly a third of his life.

I'll raise a glass and say "was hale" or perhaps wassail as an Englander might.

WD-42yesterday at 11:49 PM

Is it anger? The agent thing maybe. The other two points seem to boil down to:

1. Kotlin is a hack and 2. Rust is more fun.

Pretty understandable why one would simply want to move on to greener pastures.

show 2 replies
jeremyjhtoday at 3:00 AM

In retrospect - from an outside point of view - it seems they should have just declined to support Kotlin. There are other options for Kotlin, and it sounds like it makes sense for it to have something developed for that from the beginning. But probably they had no idea what they were getting into when it was first proposed.

emodendroketyesterday at 11:33 PM

At the end of the day I think there's nothing wrong with the tool itself. The problem is that mocking and spies make it easy to not bother properly isolating the effects of a function for testing and then you end up having a test where 95% of it is setting up an elaborate array of mocks to create the condition you wish to test, which are completely incomprehensible to the next person trying to read it.

show 1 reply