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

[Proposal] Mock Everything #19

Closed
Nillerr opened this issue Dec 21, 2021 · 1 comment
Closed

[Proposal] Mock Everything #19

Nillerr opened this issue Dec 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Nillerr
Copy link
Collaborator

Nillerr commented Dec 21, 2021

Description

It is common in the Java world to not want to introduce an interface only for the sake of testing, due to Java classes and members being non-final by default. Mockative can enable mocking of open and abstract classes and members by generating mocks for these the same as they're currently generated for interface types. The catch is we'll need to recursively generate mocks for the dependencies of these classes as well, in order to construct instances of the mocks.

Notes

Generating mocks for open classes and members can also enable implicitly stubbing members like in Mockito, as long as the return types themselves are also open and can have mocks generated for them. While this may be more feasible with class mocks, it is not a goal of this proposal.

@Nillerr Nillerr added the enhancement New feature or request label Dec 21, 2021
@Nillerr
Copy link
Collaborator Author

Nillerr commented Apr 13, 2024

Implemented by @kris098e in #83

@Nillerr Nillerr closed this as completed Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant