v4.0.0.RC1
·
156 commits
to master
since this release
This major release fixes a couple of design issues that have been reported against v3. Random Beans used to provide several configuration options in preference to strategy interfaces allowing the user to customize key behaviours. This has been fixed in this major version. Three strategy interfaces have been introduced allowing to customize the internal behaviour of the randomization process:
ExclusionPolicy: Strategy interface for field/type exclusion (See #349)ObjectFactory: Strategy interface for object creation (See #341)RandomizerProvider: Strategy interface to provide randomizers for field/type (See #350)
Custom implementations can be provided through the newly added EasyRandomParameters API:
EasyRandomParameters parameters = new EasyRandomParameters()
.objectFactory(new MyObjectFactory())
.exclusionPolicy(new MyExclusionPolicy())
.randomizerProvider(new MyRandomizerProvider());
EasyRandom easyRandom = new EasyRandom(parameters);Migration guide
- The base package has been renamed from
io.github.benastoorg.jeasy - The
groupIdof the project has been changed toorg.jeasy - The
artifactIdrandom-beanshas been renamed toeasy-random-core - The
artifactIdrandom-beans-validationhas been renamed toeasy-random-bean-validation - The
artifactIdrandom-beans-randomizershas been renamed toeasy-random-randomizers io.github.benas.randombeans.api.EnhancedRandomclass has been renamed toorg.jeasy.random.EasyRandomEnhancedRandomParametershas been renamed toEasyRandomParameters- The
EnhancedRandomBuilderhas been removed in favor of the fluentEasyRandomParametersAPI - The
io.github.benas.randombeans.util.Constantsclass has been removed and all parameter default values are now defined inEasyRandomParameters - The
io.github.benas.randombeans.util.Rangeclass has been moved as an inner class ofEasyRandomParameters - Excluded fields (var args) in the
EasyRandom#nextObjectmethod have been removed. Field exclusion must be defined throughEasyRandomParameters - If you are migrating from v3.9,
RandomizerContext#getTypehas been renamed toRandomizerContext#getTargetType - If you are migrating from v3.9,
RandomizerContext#getRandomizationDepthhas been renamed toRandomizerContext#getCurrentRandomizationDepth - All deprecated APIs have been removed
If you have any problem, please do not hesitate to open an issue and I would love to help!
I would like to thank all contributors for their help moving the project forward and making it better release after release!