Closed keremulutas closed 6 years ago
Yes, we have that idea in mind, but still thinking about proper syntax for it. Do you maybe have an idea how would you describe it through Ranger DSL?
Just thinking out loud. Given:
class MyObject {
List<Integer> myRandomLengthList;
}
a nice to have syntax could be like this:
ObjectGenerator<MyObject> myObject = new ObjectGeneratorBuilder()
.prop("myRandomLengthList", list(1, 3, random(range(1,255)))
.build(MyObject.class);
where, 1 is the minimum element count, 3 is the maximum element count, random(...) is the generator for the list elements.
An overload could be added so exactly n instances generated by the list element generator would be added to the list.
@keremulutas Proposed solution seems nice, it would only need to include configuration based DSL with same functionality, do you care to implement it and create pull request?
Pull request opened (#177) - closing this issue.
API documentation shows there is no support for this.
It would be really nice if we had the chance to, say, generate a list of Date objects with random length between 3 - 7