dhamini-poornachandra / mockito

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

with RETURNS_DEEP_STUBS, you cant't use do(Return)/when notation #332

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When you use RETURNS_DEEP_STUBS as an 'answer' for a mock, you can't use the 
do(Return)/when notation
Only the when/then(Return)

e.g.:
when(mock.getPersonInfo().getName()).thenReturn("john doe");
=> this works!

doReturn("john doe").when(mock.getPersonInfo()).getName();
=> this won't work :-(

Best regards,
Tim

Original issue reported on code.google.com by timvl...@gmail.com on 5 Apr 2012 at 6:03

GoogleCodeExporter commented 8 years ago
Mmhhh, interesting, it might be possible to make it work.

Thx for the report.

Original comment by brice.du...@gmail.com on 5 Apr 2012 at 6:24

GoogleCodeExporter commented 8 years ago

Original comment by brice.du...@gmail.com on 20 Jul 2012 at 10:45

GoogleCodeExporter commented 8 years ago
Hi,

Is this fix planned in the near future?

Grtz,
Tim

Original comment by timvl...@gmail.com on 5 Sep 2012 at 10:22

GoogleCodeExporter commented 8 years ago
Hi,
Nope we havn't worked on it yet. Though if you feel it you can hack in mockito 
and see what you can do ;)
That would be welcome.

Cheers
Brice

Original comment by brice.du...@gmail.com on 5 Sep 2012 at 10:33

GoogleCodeExporter commented 8 years ago
Hi,

I have tried the below approach and neither working.
when(mock.getPersonInfo().getName()).thenReturn("john doe");

Thanks,
Pipo

Original comment by taga.sin...@gmail.com on 11 Jan 2013 at 10:30

GoogleCodeExporter commented 8 years ago
any updates on this?

Original comment by Mr.Amut...@gmail.com on 20 May 2013 at 10:04

GoogleCodeExporter commented 8 years ago
Sorry I have been busy on other matter and then quite lazy on mockito lately. 
It's a shame but I'm not sure I can give Mockito a priority right now.

Regards,
Brice

Original comment by brice.du...@gmail.com on 20 May 2013 at 10:50