Hi,
I wondering how to get from session object values of feeded 2 records.
As I see there is java.lang.Object
and I don’t have idea how to extract from it values.
I want to System.out.println
values of this object.
Any hint is appreciated
My code:
package pl.gemiusz;
import io.gatling.javaapi.core.ScenarioBuilder;
import io.gatling.javaapi.core.Simulation;
import io.gatling.javaapi.http.HttpProtocolBuilder;
import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Stream;
import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.http;
public class Case0015UUIDfeederTwoRecordsAtTheSameTimeSimulation extends Simulation {
HttpProtocolBuilder httpProtocol =
http
.baseUrl("https://postman-echo.com");
Iterator<Map<String, Object>> feederUUID =
Stream.generate((Supplier<Map<String, Object>>) () -> {
String uuidString = UUID.randomUUID().toString();
return Collections.singletonMap("uuidString", uuidString);
}
).iterator();
ScenarioBuilder scn =
scenario("GeMi_UUIDfeederTwoRecordsAtTheSameTimeSimulation")
.feed(feederUUID, 2)
.exec(
http("GeMi_UUIDfeederTwoRecordsAtTheSameTimeSimulation_get")
.get("/get?foo=#{uuidString(0)}&bar=#{uuidString(1)}")
.check(jmesPath("args.foo").isEL("#{uuidString(0)}"))
.check(jmesPath("args.bar").isEL("#{uuidString(1)}"))
).exec(session -> {
System.out.println("GeMi_feederUUID_uuidString(0): " + session.get("uuidString"));
return session;
});
{
setUp(scn.injectOpen(atOnceUsers(1)).protocols(httpProtocol));
}
}