Closed GoogleCodeExporter closed 8 years ago
Hey,
Unfortunately it cannot be fixed due to how java works. It is related to the
order of evaluation of statements in java: arguments are evaluated first.
In this case please consider using doReturn() syntax - it does not have this
issue.
Original comment by szcze...@gmail.com
on 27 Jul 2010 at 10:31
but, inside the when() method, the mock is called, not the real method.
can't the mock behavior (in this case, "call the real deal") be triggered
lazily. can't the when() method tell the mock "ok you are good to go" after it
registered everything ? what about putting a proxy around the mock ?
Original comment by Alexandr...@gmail.com
on 27 Jul 2010 at 3:05
As Szczepan mentions, it's impossible. Imagine you want to call your real
method. How would that differ from using it in when()? There is no way to
distinguish it.
Original comment by bbankow...@gmail.com
on 27 Jul 2010 at 3:17
Although we believe it is impossible, @Alexandru, you're welcome to try fixing
it :)
Original comment by szcze...@gmail.com
on 27 Jul 2010 at 3:41
Original issue reported on code.google.com by
Alexandr...@gmail.com
on 27 Jul 2010 at 10:22Attachments: