mensahs / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

willThrow and doThrow() accepting Class<? extends Exception> overloaded versions #215

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, org.mockito.BDDMockito.BDDMyOngoingStubbing#willThrow (and other 
variations of this method) accept instance of the exception to be thrown.

It would be nice to have a overloaded version that accept Class instance of 
exception. Mockito would create exception instance using reflection and default 
c-tor. The whole point of this improvement is to get rid of "Runtime exception 
not thrown" inspection/warning in some tools/IDEs (like IntelliJ IDEA).

Original issue reported on code.google.com by nurkiew...@gmail.com on 31 Aug 2010 at 9:05

GoogleCodeExporter commented 8 years ago
hmmmm interesting idea.
We'll consider this. The downside is that we need to extend the API.

In meantime you can create your own MyBDDMockito :)

Cheers!

Original comment by szcze...@gmail.com on 2 Sep 2010 at 5:18

GoogleCodeExporter commented 8 years ago
Could be done when/if we work on issue 146.

Original comment by brice.du...@gmail.com on 3 Dec 2010 at 2:49

GoogleCodeExporter commented 8 years ago
Issue 237 has been merged into this issue.

Original comment by szcze...@gmail.com on 12 Dec 2010 at 10:27

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 12 Dec 2010 at 10:27

GoogleCodeExporter commented 8 years ago

Original comment by brice.du...@gmail.com on 23 Dec 2010 at 1:04

GoogleCodeExporter commented 8 years ago
fixed by revision 31f383979d

Original comment by brice.du...@gmail.com on 25 Dec 2010 at 6:20

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 3 Jul 2011 at 12:43