joepadde / mockito

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

Missing javadoc - I don't understand usage #471

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The @Mock annotation has an example usage in javadoc, but I do not understand 
the usage and the optional elements miss their own javadoc. Could you please 
provide more clarification for user beginners? 

http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mock.html#name()

    @Mock(name = "database") private ArticleDatabase dbMock;
    @Mock(answer = RETURNS_MOCKS) private UserProvider userProvider;
    @Mock(extraInterfaces = {Queue.class, Observer.class}) private  articleMonitor;

Original issue reported on code.google.com by MimK...@gmail.com on 25 Jan 2014 at 7:28

GoogleCodeExporter commented 8 years ago
Can you go through the documentation and examples found in org.mockito.Mockito 
class first? I hope it clarifies the api for you.

Original comment by szcze...@gmail.com on 26 Jan 2014 at 9:04

GoogleCodeExporter commented 8 years ago
I don't wanna seem lazy here, I read the documentation and ctrl+f for @Mock 
there and there are only few references to it and no example usage of the name, 
answer and extraInterfaces optional parameters in the Mockito class. I mean, it 
is not extremely important for me, but I was just really curious about how it 
works and where to use these features and I really can't seem to find the 
description for this specific part of the API. If you're not interested to 
explain, I understand, probably some other important things to do, but do 
notice, that non-experts might not understand the usage of these (including me) 
and the javadoc has no information attached about it.

Original comment by MimK...@gmail.com on 30 Jan 2014 at 10:50

GoogleCodeExporter commented 8 years ago
They are the annotation counterpart of the `MockSetting` configuration class. 
Do you have ideas to improve the javadoc ?

Don't hesitate to propose a PR on github also, with javadoc improvements.

Cheers,
Brice

Original comment by brice.du...@gmail.com on 4 Mar 2014 at 9:40

GoogleCodeExporter commented 8 years ago

Original comment by brice.du...@gmail.com on 5 Aug 2014 at 1:31