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

MockBuilder.addMockedMethod should fail for final methods #55

Closed
henri-tremblay opened this Issue Jun 3, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@henri-tremblay
Contributor

henri-tremblay commented Jun 3, 2015

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


MockBuilder.addMockedMethod should throw an IllegalArgumentException if the method is final. Currently, the method call seems to succeed, but the method is not mocked, leading to unexpected behaviour (I just fell in this trap). Since as documented mocking of final methods is not supported, trying to mock a final method should fail fast.

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

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

@henri-tremblay

This comment has been minimized.

Show comment
Hide comment
@henri-tremblay

henri-tremblay Jun 3, 2015

Contributor

Original comment author: Henri Tremblay


Now an exception is thrown when providing a final method

Contributor

henri-tremblay commented Jun 3, 2015

Original comment author: Henri Tremblay


Now an exception is thrown when providing a final method

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