Setting field value
This practice deals with manipulation
set
0. Class
public class Generate {
String value;
List<String> values;
}
1. Generating ArbitraryBuilder
ArbitraryBuilder<Generate> generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class);
2. Setting value
Setting field
generateBuilder.set("value", "test");
generateBuilder.setExp(Generate::value, "test");
Setting field n-th element
generateBuilder.set("values[n]", "test");
generateBuilder.setExp(Generate::values[n], "test");
Setting field all elements
generateBuilder.set("values[*]", "test");
generateBuilder.setExp(Generate::values["*"], "test");
Setting field to arbitrary value
generateBuilder.set("value", Arbitraries.strings());
generateBuilder.setExp(Generate::value, Arbitraries.strings());
Setting field n-th element to arbitrary value
generateBuilder.set("values[n]", Arbitraries.strings());
generateBuilder.setExp(Generate::values[n], Arbitraries.strings());
Setting field all elements to arbitrary value
generateBuilder.set("values[*]", Arbitraries.strings());
generateBuilder.setExp(Generate::values["*"], Arbitraries.strings());