Closed almondtools closed 5 years ago
The value of this feature increases if factory methods could be reused in all tests using the same object. Yet this requires the test generator to recognize the variable parts of the factory. A generic approach gets harder in this case.
I will downsize the problem to:
It should be possible to point the generator to use a given factory (with @Factory
) similar to @Builder
:
By annotating values with
@PreferFactories
we could point the generator to put the creation of this value in its own factory method - rather than into the test.This annotation may be extended by an attribute that holds a builder/factory class, that should be used to construct an object.