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

Dynamically create mock instance. #741

Open
scheruga opened this issue Mar 8, 2023 · 0 comments
Open

Dynamically create mock instance. #741

scheruga opened this issue Mar 8, 2023 · 0 comments

Comments

@scheruga
Copy link

scheruga commented Mar 8, 2023

Please provide the following information:

  • JMockit 1.48

Since it is no longer possible to mock a super class directly,
I would like to do it by useing new MockUp whith a generic implementation of
Object $advice(Invocation inv)

I would like to return an instance of a newly created mocked object all the time.
The type of the returned instance would be of ((Method)inv.getInvokedMember()).getReturnType()

Therefore I would need a possibility to create a Mocked instance dynamically.
(Like requested at #46)

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