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

Added validation for classes that override methods from super #704

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmf-tls
Copy link

@jmf-tls jmf-tls commented Mar 8, 2021

No description provided.

@jmf-tls
Copy link
Author

jmf-tls commented Mar 8, 2021

With the overridden method the tests in FakedClassWithSuperClassTest fail with the following errors:

[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.244 s <<< FAILURE! - in mockit.FakedClassWithSuperClassTest
[ERROR] fakeOnlyInstancesOfTheClassSpecifiedToBeFaked(mockit.FakedClassWithSuperClassTest)  Time elapsed: 0.191 s  <<< ERROR!
java.lang.StackOverflowError

[ERROR] fakeOnlyInstancesOfTheClassSpecifiedToBeFaked_usingFakeMethodBridge(mockit.FakedClassWithSuperClassTest)  Time elapsed: 0.039 s  <<< ERROR!
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.Integer
        at mockit.FakedClassWithSuperClassTest.fakeOnlyInstancesOfTheClassSpecifiedToBeFaked_usingFakeMethodBridge(FakedClassWithSuperClassTest.java:57)

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

Successfully merging this pull request may close these issues.

1 participant