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.benas
toorg.jeasy
- The
groupId
of the project has been changed toorg.jeasy
- The
artifactId
random-beans
has been renamed toeasy-random-core
- The
artifactId
random-beans-validation
has been renamed toeasy-random-bean-validation
- The
artifactId
random-beans-randomizers
has been renamed toeasy-random-randomizers
io.github.benas.randombeans.api.EnhancedRandom
class has been renamed toorg.jeasy.random.EasyRandom
EnhancedRandomParameters
has been renamed toEasyRandomParameters
- The
EnhancedRandomBuilder
has been removed in favor of the fluentEasyRandomParameters
API - The
io.github.benas.randombeans.util.Constants
class has been removed and all parameter default values are now defined inEasyRandomParameters
- The
io.github.benas.randombeans.util.Range
class has been moved as an inner class ofEasyRandomParameters
- Excluded fields (var args) in the
EasyRandom#nextObject
method have been removed. Field exclusion must be defined throughEasyRandomParameters
- If you are migrating from v3.9,
RandomizerContext#getType
has been renamed toRandomizerContext#getTargetType
- If you are migrating from v3.9,
RandomizerContext#getRandomizationDepth
has 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!