0

when developing I like to run tests in isolation, but obviously when in production the tests get run as part of suite, so in my code I have this :

 verify(myService, atLeast(1)).save((MyPojo) any());
 verify(myService, atMost(2)).save((MyPojo) any());

is there a better way - I am using Mockito.

My mocks are created via spring and mockito, so a mock instance is shared between the methods of a test class.

4

1 回答 1

0

使用 Mockito,我可以简单地使用reset 方法。专为基于容器的模拟注入而设计。

于 2013-08-20T13:57:09.853 回答