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

Allow not-quite-beans to be tested #6

Open
piefel opened this issue Sep 9, 2016 · 1 comment
Open

Allow not-quite-beans to be tested #6

piefel opened this issue Sep 9, 2016 · 1 comment

Comments

@piefel
Copy link

piefel commented Sep 9, 2016

This library is great! Great for testing Lombok-generated equals-and-hashcode, for instance. However, in our context we do not care much about actual JavaBeans, for instance many classes do not have a default constructor, instead a constructor for all arguments. Some are even immutable.

Unfortunately, these classes cannot be tested with bean-matchers, even testing for a valid hashcode results in “Bean does not have no-args constructor”. It would be nice to lift that requirement – perhaps by registering default instances or by alternatively using the all-args-constructor for setting the values.

@theigl
Copy link

theigl commented Nov 27, 2016

I came here to say the same. It would be great if it was possible to register a custom factory for beans, so Lombok classes could be instantiated via @builder or @AllArgsConstructor, or use bean-matchers on already constructed objects instead of classes.

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

No branches or pull requests

3 participants