cloud1105 / mockito

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

Allow customization of default settings #452

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I would like the default settings to be customizable.

My use case is that I want an eclipse plugin that provides an addition to the 
java editor like eclemma (http://www.eclemma.org/) does. But in a way that it 
doesn't show code coverage but mock invocation coverage. So for the execution 
of a unit test the plugin will store the location of the invocation and its 
verification status. This will yield in green(verified invocation), 
yellow(unverified invocation) and red(failed invocation) annotations of the 
source in the java editor.

To achieve this I need to add an InvocationListener that is notified of all 
mock invocations during a set of unit tests.

If mockito would allow customization of default settings this would be easily 
achievable by adding that that invocation listener to the default configuration.

Original issue reported on code.google.com by Andreas....@mgm-tp.com on 13 Sep 2013 at 10:49

GoogleCodeExporter commented 8 years ago
Interesting idea. We already have an invocation listener in our code, but you 
have to programmatically add them per mocks.

That would be interesting to have this default setting. Did you take a look at 
the the IMockitoConfiguration / DefaultMockitConfiguration mechanism.

If you can craft a PR on github we would definitely take a look at the code 
(given enough free time).

Original comment by brice.du...@gmail.com on 4 Dec 2013 at 3:02