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

Add support for Optional #109

Closed
JanSchankin opened this issue Mar 11, 2022 · 0 comments
Closed

Add support for Optional #109

JanSchankin opened this issue Mar 11, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JanSchankin
Copy link
Contributor

Currently Optionals cannot be persisted. An attempt to do this results in the following Exception:

de.ppi.deepsampler.persistence.error.PersistenceException: The type class java.util.Optional includes at least one final field. Therefore we tried to automatically detect a constructor accepting all field values, but weren't able to find any. If you still want to transform the bean you have to implement a BeanFactoryExtension which is able to construct the desired type class java.util.Optional.

Since Optional is part of standard Java and quite common, DeepSampler should bring it's own BeanFactoryExtension, so that no custom implementations are necessary.

@JanSchankin JanSchankin added the enhancement New feature or request label Mar 11, 2022
@JanSchankin JanSchankin added this to the v2.0.1 milestone Mar 11, 2022
@JanSchankin JanSchankin self-assigned this Mar 11, 2022
JanSchankin added a commit that referenced this issue Mar 14, 2022
JanSchankin added a commit that referenced this issue Mar 14, 2022
🥯 #109 Introduction of a BeanConverterExtension for Optional
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