Hello Gatling people, in the company I work at we are trying to migrate from Gatling-Scala version 3.6 to Gatling-Java 3.9.
I came through this issue where I’m unable to feed multiple data with a normal feeder, here is a sample code from the Scala version:
val feeder_US = Iterator.continually(Map(
"billing_address_Digital" -> "888 7th ave",
"billing_city_Digital" -> "New York",
"State_Digital" -> "NY",
"zip_online_Digital" -> "10106",
"billing_address_Studio" -> "46-024 Kamehameha Hwy",
"billing_city_Studio" -> "Kaneohe",
"State_Studio" -> "HI",
"zip_online_Studio" -> "96744",
"Market" -> "en-US",
"local" -> "US",
"randstring" -> ("US" + System.currentTimeMillis),
"TimeZone" -> "-05:00",
"plan_Digital" -> "digital",
"plan_Studio" -> "studio"
))
and here is a Java version of the feeder but it only detects the first value in the rest of the script:
static Iterator<Map<String, Object>> feeder_US =
Stream.generate((Supplier<Map<String, Object>>) () -> {
String Level = "info";
String billing_address_Digital = "888 7th ave";
String billing_city_Digital = "New York";
String State_Digital = "NY";
String zip_online_Digital = "10106";
String billing_address_Studio = "46-024 Kamehameha Hwy";
String billing_city_Studio = "Kaneohe";
String State_Studio = "HI";
String zip_online_Studio = "96744";
String Market = "en-US";
String local = "US";
String TimeZone = "-05:00";
String plan_Digital = "digital";
String plan_Studio = "studio";
String randString = ("US" + System.currentTimeMillis());
return Collections.singletonMap("Level ", Level );
} ).iterator();
How to feed all of those values with the Java version?