No worries Zarar. Another thing you might consider doing is statically importing Mockto.when, that way you don't need to keep having "Mockito." in your tests. In a similar way that most people would statically import assertThat. Hope it helps!
Yes, I definitely do that. How many uses of an assert statement do you generally wait for before doing the static import? I think I wait for about three.
I usually do it straight away for mockito and junit methods. The reason being that although it may not be necessary in that class, generally across the project you'll be using mockito and junit in every test class, so it becomes a norm. It's a bit off if you have some tests statically importing it and others not, so realising that I'm going to use it a lot, I just go for it :).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
No worries Zarar. Another thing you might consider doing is statically importing Mockto.when, that way you don't need to keep having "Mockito." in your tests. In a similar way that most people would statically import assertThat. Hope it helps!
Yes, I definitely do that. How many uses of an assert statement do you generally wait for before doing the static import? I think I wait for about three.
I usually do it straight away for mockito and junit methods. The reason being that although it may not be necessary in that class, generally across the project you'll be using mockito and junit in every test class, so it becomes a norm. It's a bit off if you have some tests statically importing it and others not, so realising that I'm going to use it a lot, I just go for it :).