Skip to content

Support Collections in Chained Field-Customisation #122

@jk-idealo

Description

@jk-idealo

Currently, fields can be customized even when deeply nested:

fixture().build(MyClass.class).with("property.childProperty", 42).create();
fixture().build(MyClass.class).without("property.childProperty").create();

This does not work, if property is a collection, because collections do not have a property childProperty.

Given the following structure:

public record Parent(List<Child> children) {
    public record Child(BigDecimal value) {}
}

I would like to customize value for all children by using:

fixture().build(Parent.class).with("children.value", BigDecimal.valueOf(42L)).create();
fixture().build(Parent.class).without("children.value").create();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions