I just want to know that the difference between times (0) and never () is in JUnit testing. For example, I have a test string code to save data in mongoDB:
verify(mockRepository,never()).save(any(User.class));
if I write it like:
verify(mockRepository,times(0)).save(any(User.class));
Both tests show that the save method did not call. (correct me if I am wrong) Is there a difference between the two?
Thanks and respect,
source share