With EasyMock 3, My test runs and pass individually, but not pass when I run all test of a package at the same time. I do the setup (EasyMock.createNiceMock...)
and the tearDown (EasyMock.resetToDefault()...). The trace is:
ava.lang.IllegalStateException: 0 matchers expected, 1 recorded.
This exception usually occurs when matchers are mixed with raw values when recording a method:
foo(5, eq(6)); // wrong
You need to use no matcher at all or a matcher for every single param:
foo(eq(5), eq(6)); // right
foo(5, 6); // also right....
The matchers are correct (individually works). I insert one parameter. But when I run the entire package, and debug inside Easymock, it enters in a for loop. Inside it it puts the same matcher twice in the method. and appears this error,