gordonad / powermock

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

Support dynamic expectations in MockPolicies #104

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Settings up expectations in mock policies is possible today but you can't
invoke the mock dynamically/lazily. E.g. if setup the following:

expect(myMock.invokeMethod).andReturn(someThing);

we need a way to return "someThing" when the "invokeMethod" is invoked by
the MockGateway. One solution would be to pass an interface (like IAnswer)
to the addSubstituteReturnValue method. If the mock gateway discovers that
the return value is of this type it could invoke a method on this interface
(which returns "someThing") instead of returning it directly.

Original issue reported on code.google.com by johan.ha...@gmail.com on 18 May 2009 at 8:11

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 11 Sep 2009 at 6:23

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 22 Sep 2009 at 7:46

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 4 Oct 2009 at 10:15

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 10 Mar 2010 at 1:31

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 22 Jul 2010 at 9:16