Conversation
|
Do you have evidence it actually is the default? And for example https://github.com/mockito/mockito/blob/main/mockito-core/src/main/java/org/mockito/MockSettings.java#L373 says the default is lenient. |
|
It seems that you're right, I'm sorry. But at least, Mockito has planned to migrate to strict mocks for a very long time, initially it was planned to Mockito v3. So I think it is at least it does not make much sense to say that Spock like Mockito relies on lenient mocks. Becuase Mockito does not recommend that. |
|
Well, having a look at their docs I'd say even if it were enabled by default, it is not the strictness we talk about here. As far as I understood those docs, even with using Mockito strict mode you still need to use It is "a bit stricter" by failing if you do stub a method and it gets called but with different arguments it fails and if you do stub a method and it is not called it fails. But that's imho merely a "mistyped" protection or "refactored" protection but not the strictness mentioned here where any call on the mock would fail. 🤷♂️ |
|
@leonard84 what do you think? |
|
Unfortunately the term "strict" is used very differently. EasyMock for example also has a strict mode, that there means that also invocation order is checked. |
|
Calling Mockito's I agree with @Vampire that "strictness" is not well-defined. We can remove the |
In reality, Mockito is really using stricts mocks by default since 4 major release. So I think it is worth updating this doc :)