Hi!
I have a Json file with feedbacks that I want to use in my scenario. But I have several types of feedback and therefore I have a method called buildMessage where I want to build the request body. But how can I send the json object from the feeder to the buildMessage method?
`
class FeedbackSimulation extends Simulation {
val feedbacks = jsonFile(“feedbacks.json”).circular
val httpConf = http
.baseURL(“https://localhost:443”)
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”)
.doNotTrackHeader(“1”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.acceptEncodingHeader(“gzip, deflate”)
.userAgentHeader(“Gatling2”)
val scn = scenario(“Handle feedback”)
.feed(feedbacks)
.exec(http(“Post Feedback”)
.post("/api/feedback")
.body(StringBody(HandleFeedback.buildMessage())).asXML
)
setUp(
scn.inject(rampUsers(10) over (60 seconds))
).protocols(httpConf)
}
`
[ { "type": "gnss", "lat": "61.902885", "lng": "6.714318" }, { "type": "gnss", "lat": "61.902885", "lng": "6.714318" } ]