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.
Currently
Optional
s 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.