Skip to content

Releases: j-easy/easy-random

v5.0.0

15 Nov 16:36
6267111
Compare
Choose a tag to compare

This release is the same as v4.3.0 except the removal of deprecated APIs. It is a major version upgrade as it requires Java 11 as a minimum Java version. The main reason for this major version upgrade is that Easy Random v5 will be the last feature release of the project which is going to be in maintenance mode from now on.

Migrating from v4.3 to v5.0

As mentioned above, v5 should be a drop-in replacement of v4.3 as long as you use Java 11 instead of Java 8. The following deprecated APIs have been removed in v5.0:

  • org.jeasy.random.util.DateUtils
  • org.jeasy.random.util.CollectionUtils
  • All static factory methods to create randomizers (aNewXXXRandomzier). Use the equivalent constructors instead.

v4.3.0

07 Nov 22:42
3da55eb
Compare
Choose a tag to compare

This release is the last version of the 4.x line. The next release will be v5.0 and will be based on Java 11. This release comes with the following new features, enhancements and bug fixes:

New features

  • Issue #425: Support type variables
  • Issue #417: Add support for EnumSet
  • Issue #435: Add NanoSecondRandomizer
  • Issue #429: Added Password Randomizer
  • Issue #402: Add support for fluent setters when populating bean
  • Issue #398: Add parameter to bypass setters

Enhancements

  • Issue #434: Make ObjenesisObjectFactory public
  • Issue #419: Update Javadocs of range randomizers about range boundaries

Bug fixes

  • Issue #414: Inconsistent nanosecond precision between LocalTimeRangeRandomizer and LocalDateTimeRangeRandomizer
  • Issue #413: Repeatable random object on the same seed
  • Issue #432: Pass properly updated context to a ContextAwareRandomizer
  • Issue #401: Bean validation annotation handlers don't use the defined registry
  • Issue #420: Number-based validation annotations are not supported well on primitive wrapper
  • Issue #416: Option type is incorrectly generated as Option<Object> instead of actual Option<T>
  • Issue #400: Object generation does not fail when setter invocation fails

Many thanks to all contributors who helped in making this release possible!

v4.2.0

14 Mar 23:52
860d1c7
Compare
Choose a tag to compare

This is a minor release which comes with the following enhancements and bug fixes:

Enhancements

  • Issue #355: Drop Jackson dependency
  • Issue #388: Set fields by calling setters if present before using reflection
  • Issue #389: Make the default exclusion policy public

Bug fixes

  • Issue #382: Instant bean validation range support
  • Issue #387: Collections are always generated with the same size
  • Issue #393: Trying to randomize an empty Enum fails with an IllegalArgumentException
  • Issue #396: Arrays are always generated with the same size

I would like to thank @mjureczko, @arnzel, @elexx, @LeJeanbono, @stevenvanophem and @rcsilva83 for their feedback and contributions to this release!

v4.1.0

04 Nov 21:55
9bd15bf
Compare
Choose a tag to compare

This is a minor release with the following changes:

New Features

  • Issue #358: Add randomizers for MAC, IPv4 and IPv6 addresses
  • Issue #376: Make rounding mode configurable in BigDecimalRandomizer
  • Issue #377: Make rounding mode configurable in BigDecimalRangeRandomizer

Enhancements

  • Issue #368: Performance improvement in FieldPredicates
  • Issue #360: Performance improvement of max Size
  • Issue #365: AnnotationRandomizerRegistry should cache and reuse randomizers to improve performance
  • Issue #370: Configurable temporal unit in DurationRandomizer

Bug fixes

  • Issue #361: LocalDateTimeRangeRandomizer Min-Max Exception due time of day
  • Issue #356: Incorrect current object in RandomizerContext

Many thanks to all contributors for making this happen!

v4.0.0

05 May 20:18
Compare
Choose a tag to compare

This is the first release of Easy Random v4. It fixes a couple of issues that were reported against v4.0.0.RC1:

  • Issue #353: ClassGraphFacade fails for inner classes
  • Issue #348: Bean validation's @SiZe does not work with collections

Thanks to @peter721 and @magx2 for reporting these bugs.

Major changes in the v4 line have been described in details in the change log of v4.0.0.RC1.

If you have any question, please do not hesitate to open an issue or join the gitter channel of the project.

v4.0.0.RC1

14 Mar 23:28
Compare
Choose a tag to compare

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

v3.9.0

13 Mar 22:28
Compare
Choose a tag to compare

This release is a drop in replacement for v3.8.0 and includes the following changes:

Features

  • Issue #6: Add ContextAwareRandomizer interface
  • Issue #322: Add support for regular expressions when specifying a field name
  • Issue #343: Add utility method to adapt a Supplier to a Randomizer
  • Issue #342: Add support for field definition with a predicate. See FieldPredicates
  • Issue #344: Add support for type exclusion with a predicate. See TypePredicates
  • Issue #340: Add parameter ignoreRandomizationErrors to silently ignore randomization errors
  • Issue #332: Add range randomizers for more java.time types

Bug fixes

  • Issue #328: Past/Future annotation cannot be applied to java8 date types
  • Issue #336: ZonedDateTime type is not randomized in the specified date/time range
  • Issue #330: Issue with regexp with both leading and tailing boundary (^ $) matchers

Deprecations

  • Issue #345: Rename method EnhancedRandomBuilder.registerRandomizerRegistry to EnhancedRandomBuilder.randomizerRegistry. The former is deprecated and will be removed in the next major version
  • Issue #342: Deprecate FieldDefinition in favor of predicate combination.

Many thanks to @eric-taix, @kkurczewski, @neetkee, @weronika-redlarska and @PascalSchumacher for their contributions to this release!

❗️ Please note that v3.9.0 is the last release in the v3 line.

v3.8.0

27 Jan 21:43
Compare
Choose a tag to compare

This is a minor release and probably the last one in the v3.x line. It can be a drop-in replacement for v3.7.0. The main changes are:

New features

  • Issue #277: Add support for Bean Validation 2.0
  • Issue #265: Email randomizer should not generate email addresses with valid domains
  • Issue #287: Add a Number Randomizer
  • Issue #260: Add support for java.time.ZoneId

Bug fixes

  • Issue #280: Regression in Exception field generation in java 9
  • Issue #299: How to pass values to GenericStringRandomizer with @Randomizer annotation
  • Issue #315: Wrong generated values when regexp owns boundary matchers (eg ^ $)
  • Issue #282: bug in StringRandomizer for large String
  • Issue #318: Incorrect random float generation in a given float range
  • Issue #288: @DecimalMin / @DecimalMax generating invalid value (missing fractional part)

Enhancements

  • Issue #316: AbstractRandomizerRegistry should be public
  • Issue #259: Update Javadoc to mention that static methods do not take into account configuration parameters
  • Issue #264: Rename data resource for bundle to avoid collisions

Deprecations

  • Issue #327 : Deprecate Spring support
  • Issue #326: Deprecate Jodatime support

Many thanks to @ Spikhalskiy, @ashbike, @tnmtechnologies, @aewhite, @AVE-cesar, @Redid, @magx2, @aabashkin, @DeGuitard, @chintebay, @aeneal, @avillev and @marcovb279 for reporting bugs, testing fixes and suggesting features! Special BIG thanks to @PascalSchumacher for his continuous amazing work on Random Beans. I'm really grateful to all of you!

v3.7.0

18 Jun 23:14
Compare
Choose a tag to compare

This is a minor release and can be a drop-in replacement of v3.6.
Here are the main changes introduced in this version:

New Features

  • issue #246 : Add ability to randomize types with protected constructor
  • issue #250 : Add ability to randomize types with Bean Validation annotations placed on getters

Fixed Bugs

  • issue #258 : Dependency check issue

Enhancements

  • issue #243 : Make random-beans build on java 9
  • issue #252 : refactor the objects stream to generate values lazily
  • issue #253 : improve code of getting the wrapper type of a primitive type

We would like to thank @murphd40 , @sparty02 , @VanOvermeire , @pgaschuetz and @huningd for their contributions to this release. A big thank goes to @PascalSchumacher for his amazing work on random beans!

v3.6.0

05 Mar 22:18
Compare
Choose a tag to compare

This is a minor release with the following additions:

Features

  • issue #239 : Add the ability to exclude some values from an enumeration values set
  • issue #244 : Add support for BigDecimal scale

Fixed bugs

  • issue #241 : IntegerRangeRandomizer does not generate random values in the given range
  • issue #237 : Bean Validation randomizers do not generate random values
  • issue #234 : RandomizerProxy fails to create the proxy when the Supplier is specified as lambda

Many thanks to @euZebe , @petromir , @devoto13 and @LucasAndersson for their valuable contributions to this release!

A special big thank goes to @PascalSchumacher for his excellent active work on random beans.