dhamini-poornachandra / mockito

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

Define Answer with @Mock #319

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The annotation @Mock doesn't allow me to define the mock answers, like 
RETURNS_MOCKS, RETURNS_SMART_NULLS, RETURNS_DEEP_STUBS, etc.

So i need to call Mockit.mock(anyInterface.class, RETURNS_MOCKS), for example.

I think that the annotation @Mock could allow me to define the mock answers. 
The effect would be the same of Mockit.mock(anyInterface.class, RETURNS_MOCKS).

Original issue reported on code.google.com by wesleyl...@gmail.com on 23 Feb 2012 at 5:20

GoogleCodeExporter commented 8 years ago
Hi, it's available since some time already : 
http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mock.html

Original comment by brice.du...@gmail.com on 23 Feb 2012 at 5:38

GoogleCodeExporter commented 8 years ago
That is exactly what i need. Perfect!!

Thank you for your fast response!

Original comment by wesleyl...@gmail.com on 23 Feb 2012 at 5:42

GoogleCodeExporter commented 8 years ago
I already have changed my test code and it has worked perfect!

The test code is cleaner now.

Thank you very much for your help!

This issue can be closed.

Original comment by wesleyl...@gmail.com on 23 Feb 2012 at 5:50

GoogleCodeExporter commented 8 years ago
You are welcome :)
Please ask the mailing list first ;)

Original comment by brice.du...@gmail.com on 23 Feb 2012 at 5:52

GoogleCodeExporter commented 8 years ago

Original comment by brice.du...@gmail.com on 23 Feb 2012 at 5:52

GoogleCodeExporter commented 8 years ago
Ok. I have searched about it in mockito doc before. Now i saw that it is old. :S
Sorry.

http://mockito.googlecode.com/svn/branches/1.5/javadoc/index.html?org/mockito/Mo
ckito.html

Original comment by wesleyl...@gmail.com on 23 Feb 2012 at 5:56

GoogleCodeExporter commented 8 years ago
Yeah google is showing the older javadoc, it's actually a pain. You should use 
the link displayed on the project site.

Original comment by brice.du...@gmail.com on 23 Feb 2012 at 6:10