Skip to main content
Version: v1.2.x

v1.2.x

v1.2.1

Features

  • object-farm-api (0.1.30.1.4): add InlinedValueResolver and a FieldExtractor#reflection(InlinedValueResolver) overload, so a JVM language plugin can rebuild value types the language inlines into their owner's field.

Improvements

  • JvmTypeSystem (EXPERIMENTAL) now takes the individual parts a plugin contributes — nodePromoters(...), leafTypeResolvers(...), candidateGeneratorWrapper(...), inlinedValueResolver(...) — in place of assemblyPlanner(AssemblyPlanner), and FixtureMonkeyBuilder builds the single AssemblyPlanner from them once every plugin has been applied. As a result, registering several JvmTypeSystemPlugins now combines what each one contributes instead of the last plugin replacing the earlier registrations.

Bug Fixes

  • Fix IllegalArgumentException when an object with a Kotlin value class property is passed whole to set(...). The same applies to any type the language inlines into its owner's field, including kotlin.time.Duration and UInt, and it also covers properties renamed by a PropertyNameResolver (e.g. Jackson's @JsonProperty).

v1.2.0

The legacy object tree engine (the default since 0.4.0) has been removed, and the adapter engine introduced as experimental in 1.1.17 is now the only and default object generation engine — wired automatically by FixtureMonkeyBuilder. Everyday APIs (ArbitraryBuilder, giveMe*, set/size/thenApply) are unchanged. Extension points that plugged into the old engine internals have been removed — see Breaking Changes. Authors of custom Property / PropertyGenerator / ArbitraryIntrospector implementations should review this release carefully.

Features

  • Add a new extension SPI for JVM languages — JvmTypeSystemPlugin / JvmTypeSystem / LeafTypeRegistry — allowing a plugin to install a custom AssemblyPlanner via FixtureMonkeyBuilder.plugin(...).
  • Add FixtureMonkeyBuilder#tracer(AssemblyTracer) to attach a resolution tracer directly for debugging value generation.
  • Add TypeReference#getJvmType() and ArbitraryGeneratorContext#getResolvedJvmType().
  • Add Types#normalizeRawType(...), a Types#toJvmType(...) overload, and Types#toAnnotatedType(JvmType) utilities.

Improvements

  • @Seed now takes precedence over FixtureMonkeyBuilder#seed(long), and the seed is scoped and released per test — even when the test or another extension throws. Previously the global seed could leak across tests or be overwritten by a builder's default System.nanoTime() seed.
  • Container sizes are now reproducible across reruns with the same seed: container-size randomness is tracked by a dedicated counter, decoupled from value generation so cache hit/miss patterns no longer perturb sizes.
  • Object generation now preserves declaration/iteration order (LinkedHashMap instead of HashMap), fixing cases where Kotlin aliased constructor parameters received values on the wrong parameter. Note: for a fixed seed, the generated random stream may differ from 1.1.x as a result.
  • FixtureMonkeyOptionsBuilder#defaultNullInjectGeneratorOperator(...) now composes successive operators instead of overwriting the previous one.
  • .size() wildcard-vs-exact-path precedence is now resolved at build time, so a higher-priority wildcard size correctly applies at a shadowed exact path.

Bug Fixes

  • Prevent IllegalArgumentException from injecting null into primitive-typed slots.
  • Prevent NullPointerException when a postCondition/filter predicate is registered at a path that would otherwise receive an injected null.
  • Prevent StackOverflowError on self-referential interface properties resolved through the anonymous-interface proxy.
  • Fix recursive/self-referential container types (e.g. a type containing List<Self>) producing unbuildable children.
  • Recognize custom container types such as Kotlin Pair/Triple correctly.
  • Fix per-type introspector chains (e.g. PriorityConstructorArbitraryIntrospector) using the wrong PropertyGenerator for nested types.

Deprecations

  • Deprecate ArbitraryGeneratorContext#getResolvedType() and #getResolvedAnnotatedType() — use #getResolvedJvmType().
  • Deprecate PropertyUtils#toProperty(AnnotatedType) — use the new toProperty(JvmType) overload.

Breaking Changes

  • Property interface: getType() is removed (use getJvmType()), getAnnotatedType() is removed, and getValue(Object) is removed (value extraction is no longer part of the Property contract). Built-in implementations (FieldProperty, ConstructorProperty, RootProperty, MapEntryElementProperty, etc.) have new constructor signatures accordingly.
  • ArbitraryGeneratorContext#getResolvedType() now returns Class<?> instead of java.lang.reflect.Type.
  • ContainerPropertyGenerator.DEFAULT_ELEMENT_RAW_TYPE is removed — use DEFAULT_ELEMENT_JVM_TYPE.
  • Remove the legacy generation engine: the c.n.f.tree.* package, c.n.f.expression.* (ArbitraryExpression, MonkeyExpression, MonkeyExpressionFactory), and the manipulator family (NodeManipulator, ArbitraryManipulator, ContainerInfoManipulator, …) together with the NodeResolver SPI. AssemblyPlanner is now used automatically.
  • Remove the experimental adapter-bridge SPI added in 1.1.17: NodeTreeAdapter, DefaultNodeTreeAdapter, JavaNodeTreeAdapterPlugin, and Kotlin's KotlinNodeTreeAdapterPlugin — replaced by the automatic AssemblyPlanner + JvmTypeSystemPlugin.
  • Remove FixtureMonkeyOptionsBuilder#nodeTreeAdapter(...) / #adapterTracer(...) and the corresponding FixtureMonkeyOptions getters. Use FixtureMonkeyBuilder#tracer(AssemblyTracer) instead.
  • object-farm-api (0.1.20.1.3): remove the JavaType class (use ReflectiveJvmType) and the deprecated JvmType#getAnnotatedType().