ahmaddarawshi / powermock

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

Should we really clear the state in verify? #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Today we face a huge problem because doing:
PowerMock.verify(mock1);
PowerMock.verify(mock2);
will clear the PowerMock state between verification of mock1 and mock2
(PowerMock.verify(mock1, mock2) would work though). This is needed because
otherwise static mocks won't go back to "normal" after invoking verify on
it. Also state such as PowerMock.niceReplayAndVerify() won't be cleared if
not using any PowerMock runner. The question is, would we want this
behavior? Should we say that the user is FORCED to always use the
PowerMockRunner when performing PowerMock tests otherwise you can't
guarantee the behavior. All JUnit runners perform clean up AFTER each test.
Perhaps this is what we want!

Original issue reported on code.google.com by johan.ha...@gmail.com on 14 Nov 2008 at 10:53

GoogleCodeExporter commented 9 years ago
No. Clear only verified objects

Original comment by jan.kron...@gmail.com on 14 Nov 2008 at 5:22

GoogleCodeExporter commented 9 years ago
Resolved

Original comment by johan.ha...@gmail.com on 17 Nov 2008 at 8:40

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 17 Nov 2008 at 8:43