projoy/mockito

Add warning about stubbing the final methods in documentation

GoogleCodeExporter opened this issue · 2 comments

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

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

  • Changed state: Invalid
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