Open
Description
Given a record like:
public record MyRecord(String fieldOne, AnotherRecord fieldTwo) {}
where AnotherRecord
is a record
When I do:
easyRandomParameters.randomize(
field -> field.equals(fieldTwoField), () -> null
);
I would expect the value for fieldTwo
to be null. This works with most primitives & other classes that are not records. However, with records, fieldTwo
is not null and still subject to value generation.
I've sort of worked around this by also adding:
easyRandomParameters.randomize(AnotherRecord.class, new SkipRandomizer());
however if in my object I have more than one field that is AnotherRecord, ie:
public record SomeOtherRecord(AnotherRecord fieldOne, AnotherRecord fieldTwo) {}
naturally both fieldOne & fieldTwo would be skipped, so it doesn't work in those scenarios. The intention is just to null out that single field (fieldTwo).
Metadata
Metadata
Assignees
Labels
No labels