Gatling 2.0. I'receiving from server the following json of Events:
[
{ "a":"a","b":"b","c":"c","d":"d"},
{ "a":"a1","b":"b1","c":"c1","d":"d2" },
{ "a":"a2","b":"b2","c":"c2","d":"d3" }
]
Now I would like to store it in session as List of Event classes
case class Event(a:String:b:String,d:String)
I'm trying to do the following
jsonPath("$.chats.chat[0].events.event").ofType[Seq[Any]].transform(_.map{ l =>
Some(Event(l(0).asInstanceOf[String], l(1).asInstanceOf[String],l(3).asInstanceOf[String])).saveAs("events")
but this line does not compile: Please help.
after it I would like to fetch this list from session, Can i do it by:
val events = session("events").as[Seq[Events]]
Thanks.