Open GoogleCodeExporter opened 9 years ago
Issue 244 has been merged into this issue.
Original comment by johan.ha...@gmail.com
on 25 Mar 2010 at 5:50
I've investigated this and it'll require big internal changes in PowerMock.
MockGateway or the MockRepository may need to be able to create mocks
dynamically
when no NewInvocationSubsitute was found OR each extension API need to be able
to
implement there own MockRepository. I.e. refactor mock repo to an interface and
let
the extension API provide it to PowerMock on bootstrap. The bootstrapper must
then
inject the impl to the mock gateway and other places where's used for each
test. I'm
changing this to future. It's probably a nice feature workarounds exist.
1) Use an ArgumentCaptor in Mockito or a Capture in EasyMock if the new
instance is
passed as a parameter to a method.
2) Setup the expectation and return a mock using PowerMock/PowerMockito.
Original comment by johan.ha...@gmail.com
on 25 Mar 2010 at 7:48
Another use case should be consided:
In the testDoIt() method, I would like to verify that constructor was never
called...
PowerMockito.verifyNew(Test2.class, never()).withNoArguments();
Original comment by yannick....@telecomnancy.net
on 29 Jul 2011 at 12:19
Original issue reported on code.google.com by
johan.ha...@gmail.com
on 25 Mar 2010 at 12:45