EasyMock

MockBuilder.addMockedMethod should fail for final methods

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.0
  • Fix Version/s: 3.1
  • Component/s: None
  • Labels:
    None

Description

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.

Activity

Hide
Henri Tremblay added a comment -

Now an exception is thrown when providing a final method

Show
Henri Tremblay added a comment - Now an exception is thrown when providing a final method

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: