loose2200 / mockito

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

Add warning about stubbing the final methods in documentation #496

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Next steps will reproduce the problem.
1. Create a class with final method 
2. Mock this class and try to stub the final method with 
when(Class.finalMethod).thenReturn(something);

This error is not obvious for me and there is no warning in documentation about 
it for when method.

I used version 1.9.5 on linux.

I think it will be useful to add warning in documentation like "Watch out" in 
spy method.

Original issue reported on code.google.com by eliseea...@gmail.com on 16 Jun 2014 at 10:01

GoogleCodeExporter commented 8 years ago
It's in the FAQ : https://github.com/mockito/mockito/wiki/FAQ

And less visible it's in the documentation : 
http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html

If you think the javadoc or documentation can be enhanced we will be pleased to 
review your propositions.

Cheers,
Brice

Original comment by brice.du...@gmail.com on 27 Jun 2014 at 3:15

GoogleCodeExporter commented 8 years ago
The documentation link was supposed to be : 
http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html#spy

Original comment by brice.du...@gmail.com on 27 Jun 2014 at 3:16