Earlier quoted context omitted.
Subclasing and overriding is not a good idea. There is no compilation failure if you forget to override a function which can lead to flakey tests at best and prod data impact at worst.
your test environment should not have the credentials to write to prod data. yiiiiikes!
Stepping down as Mockito maintainer after ten years
21–30 of 220 posts
Re: Stepping down as Mockito maintainer after ten years
#22For those, like me, who haven't heard of it: Mockito is the "most popular mocking framework for Java".
It also translates to “small booger”, in Spanish, which always made me question who thought the name was a good idea over there.
Re: Stepping down as Mockito maintainer after ten years
#23>Mockito 5 shipped a breaking change where its main artifact is now an agent. That's because starting JVM 22, the previous so-called "dynamic attachment of agents" is put behind a flag Wouldn't this hold back enterprise adoption, the same way breaking changes meant that Java 8 was widely used for a long time?
Re: Stepping down as Mockito maintainer after ten years
#24Earlier quoted context omitted.
It also translates to “small booger”, in Spanish, which always made me question who thought the name was a good idea over there.
Why? Every name you pick is likely to be weird in one language or another. Mockito does one thing well as a name, and that is hinting strongly at what it is (a mocking library).
But this name is weird in the specific language it’s imitating (both the -ito termination for diminutives and the drink on which I assumed the name is based are Spanish).
Re: Stepping down as Mockito maintainer after ten years
#25As someone who is not in the Java world, why does Java need a mocking library? Interface based polymorphism is not enough?
Mockito allows one to write mocks in tests for code that doesn't use dependency injection and isn't properly testable in any other way. On the one hand, you should just design things to be testable from the start. On the other... I'm already working in this codebase with 20 years of legacy untestable design...
Probably because they zealously followed "Effective Java" book.
Re: Stepping down as Mockito maintainer after ten years
#26Re: Stepping down as Mockito maintainer after ten years
#27As someone who is not in the Java world, why does Java need a mocking library? Interface based polymorphism is not enough?
Instead your mocks are all just inline in the test code: ephemeral, basically declarative therefore readily readable & grokable without too much diversion, and easily changed.
A really good usecase for Java's 'Reflection' feature.
Re: Stepping down as Mockito maintainer after ten years
#28What does Agent mean in this context? And what is "dynamic attachment of agents"?
Re: Stepping down as Mockito maintainer after ten years
#29What does Agent mean in this context? And what is "dynamic attachment of agents"?
Re: Stepping down as Mockito maintainer after ten years
#30Earlier quoted context omitted.
It also translates to “small booger”, in Spanish, which always made me question who thought the name was a good idea over there.
Actually, no. "small booger" would be _moquito_ in spanish.