Skip to content

Mockups with "$advice" fail when target class has private methods #703

Open
@jmf-tls

Description

@jmf-tls
  • Version of JMockit that was used:
    1.49 (also in master branch at 5c6a2df)

  • Description of the problem or enhancement request:

According to the documentation for the "$advice" method,

If defined, this fake method will handle executions of each and every method in the target class (or classes, when applying the fake over unspecified classes from a base type).

However, if the target class contains a private method, the tests fail when creating a new mock, with an IllegalArgumentException ("Unsupported fake for private method.....").
I created a pull request that adds a validation for this issue on the FakingEverythingTest: #702

In this case, I think private methods should either be supported or ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions