smartcat-labs / berserker

Berserker is load generator with pluggable input source and configurable output.
Apache License 2.0
52 stars 8 forks source link

Support empty composite value #22

Closed vajda closed 7 years ago

vajda commented 7 years ago

There are situations where empty composite value can come in handy. For example: data: user: firstName: random("John","Adam", "Peter") lastName: random("Doe", "Jackson", "Smith") fields: {} output: json($data) Generated JSON could look like: { "user": { "firstName": "Peter", "lastName": "Smith" }, "fields": {} } In this case, we want to have fields object, just we want it to be empty.

Technical approach:

This can be easily achieved by removing values.isEmpty() check from CompositeValue at line if (values == null || values.isEmpty()) {

vajda commented 7 years ago

Moved to Ranger since it is ranger issue.