I think the answer is yes, but I was unable to find anything definite in the easymock documentation.
I'm getting an error when first test is mocking a class, and then another test is using this class in a regular way. The class turns out to be mocked in the second test and fails with unexpected invocation.
Is there a way to automate the cleanup, besides using the EasyMockSupport
and calling resetAll()
in @After
method (preferably something that doesn't have to be repeated in each class)?
It seems you don't need to manually reset the mocks.
In my case the mocked class was stored in a static variable, once this was corrected the tests started running OK.
It would be nice if EasyMock reported the place where violated expectation was recorded - that would have made it much easier to find the source of the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With