New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Multiple Captures #77

henri-tremblay opened this Issue Jun 3, 2015 · 0 comments


None yet
1 participant

henri-tremblay commented Jun 3, 2015

Migrated from: CodeHaus issue EASYMOCK-66
Original reporter: Henri Tremblay

I have a method where the mocked method is called multiple times. If I use a Capture for this then the value is the one from the last call (as would be expected). If I use multiple Captures then all of them have the value from the last call - this I would not expect, see attached TestCase
I tried to override Capture and include a Collection accumulating the values see The collection then contains duplicate values indicating that the method Capture.setValue() is called once for the first call, twice for the second call etc.
I suppose this is part of how EasyMock identifies the matchers? Would it be possible to have the setValue be called only as appropriate?

thanks, Mark

@henri-tremblay henri-tremblay self-assigned this Jun 3, 2015

@henri-tremblay henri-tremblay added this to the 2.5 milestone Jun 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment