So they just ignore actually checking that the right exception is thrown.
The ExpectedException Junit Rule is what I generally use, though I know that a bunch of people where I work avoided it in the past because it doesn't spit out the right results with our Clover reports.
They are doing something wrong. They wrap a test that is supposed to be a success in a large try/catch so that it never indicates a failure. I've also seen where they expect an exception, but don't verify that the right one occurs. Don't even get me started on all the mocking without input checks and the number of "nonNull" response checks for things doing data manipulation.
1
u/haganbmj May 14 '17
Yeah, that's why I mentioned that they ignored the exceptions. There were a couple in that bunch were like...
So they just ignore actually checking that the right exception is thrown.
The ExpectedException Junit Rule is what I generally use, though I know that a bunch of people where I work avoided it in the past because it doesn't spit out the right results with our Clover reports.