I have an example of a mock that calls the same method twice.
Each time has a different matcher registered.
In some cases, the mock replay uses the first matcher for the second invocation, but not in all cases.
See attached.
I still have made a change so a matcher is not called when no results are available on a given recorded behaviour. The matcher rule is still true but EasyMock will behave more like you would expect (and I hope be a bit faster)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The attached file depends on the junit jar.
That's not the way it works. Matchers can be called any amount of times. They will just tell if it matches or not.
If you remove the assertEquals, the test runs as expected.
Does it cause you a problem? To check a parameter, you should use eq() or a Capture.
I still have made a change so a matcher is not called when no results are available on a given recorded behaviour. The matcher rule is still true but EasyMock will behave more like you would expect (and I hope be a bit faster)