oleksiyp
07/17/2019, 2:31 PMMike
07/17/2019, 3:21 PM>> Using Mockito Extension in JUnit Jupiter, and annotation based mocking results in strict checking. Basically, if no expectations are defined on a mock object, it will act like a stub. This means it will return a reasonable default for any calls.As soon as an expectation is defined, the Mock becomes strict. It will report any calls that don’t match a defined expectation AND will report any expectations that were defined, but not called. This is like defining verify on every interaction, and adding a verify no more interactions. There is no option to ensure a mock is actually used as a mock until at least one interaction is defined. The only way to ensure all mock calls are defined would be to call verify with noMoreInteractions on all mocks at the end of the test.
amatkivskiy
07/18/2019, 5:30 AMMike
07/18/2019, 10:40 AMamatkivskiy
07/18/2019, 12:35 PMMike
07/18/2019, 12:52 PMoleksiyp
07/18/2019, 12:54 PMeverythingUsed
at the end is ok?Mike
07/18/2019, 1:00 PMoleksiyp
07/18/2019, 1:01 PMMike
07/18/2019, 1:02 PMoleksiyp
07/18/2019, 1:02 PMamatkivskiy
07/18/2019, 1:13 PMFor me, I’d like both of those covered under strict mocks, but it’s not for everyone.Thats what I am looking for