Skip to content
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

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

Open
jmf-tls opened this issue Mar 8, 2021 · 0 comments
Open

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

jmf-tls opened this issue Mar 8, 2021 · 0 comments

Comments

@jmf-tls
Copy link

jmf-tls commented Mar 8, 2021

  • 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.

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

No branches or pull requests

1 participant