Skip to content

5.2.0

Compare
Choose a tag to compare
@armandino armandino released this 02 Dec 23:11
· 60 commits to main since this release

What's Changed

New Features

wordTemplate() spec that supports noun, verb, adjective, and adverb placeholders (#1220)

A spec for generating text based on a template containing placeholders, such as ${noun}, ${verb}, ${adjective}, and ${adverb}.

Example:

record Company(String website) {}

List<Company> companies = Instancio.ofList(Company.class)
    .size(3)
    .generate(field(Company::website), gen -> gen.text().wordTemplate("${adjective}-${noun}.com"))
    .create();

// Sample output:
[[Company[website=global-bidder.com],
  Company[website=independent-beat.com],
  Company[website=promotional-clock.com]]

The placeholders are case-sensitive and support three case styles for the output:

  • ${noun} - Outputs a lowercase word e.g. "cat"
  • ${Noun} - Outputs a capitalised word e.g. "Cat"
  • ${NOUN} - Outputs an uppercase word e.g. "CAT"

Throw an error by default if applyFeed() has unmapped feed properties (#1225)

This is a potential breaking change to an experimental API. The original behaviour can restored by the new setting Keys.ON_FEED_PROPERTY_UNMATCHED which can be used to ignore unmapped feed properties.

Bug Fixes

Only report the initial seed for @InstancioSource tests (#1223)


  • wordTemplate() spec that supports noun, verb, adjective, and adverb placeholders by @armandino in #1220
  • Bump com.fasterxml.jackson.core:jackson-databind from 2.18.1 to 2.18.2 by @dependabot in #1222
  • Bump version.kotlin from 2.0.21 to 2.1.0 by @dependabot in #1221
  • Bug fix: only report the initial seed for @InstancioSource tests by @armandino in #1223
  • Throw an error by default if applyFeed() has unmapped feed properties by @armandino in #1225
  • Bump org.apache.felix:maven-bundle-plugin from 5.1.9 to 6.0.0 by @dependabot in #1224
  • Bump nl.jqno.equalsverifier:equalsverifier-nodep from 3.17.3 to 3.17.4 by @dependabot in #1227
  • Bump com.puppycrawl.tools:checkstyle from 10.20.1 to 10.20.2 by @dependabot in #1226

Full Changelog: instancio-parent-5.1.0...instancio-parent-5.2.0