I am using Gatling for generating load. Here, I have a situation where I need to call a method present in an another object. The parameters to this method are values from feed file.However, from results i can see that there are no call to method.
Apologies if it is a naive question. I am new to Gatling and Scala.
`
//Method call from simulation class
val scnTrial= scenario(“trial”)
.feed(tsv(“V1.txt”).circular)
.exec(session => {
ObjectA.methodA(session(“UserID”).as[String],session(“key1”).as[String],session(“key2”).as[String])
session
})
.inject(rampUsers(1) over (1))
`
`
//Method definition
ObjectA{
def methodA(vUserID:String,vkey1:String,vkey2:String)={
exec(session=>{
session.set("UserID",vUserID).set("key1",vkey1).set("key2",vkey2)
})
.exec(http("Authenticate")
.post("/abc/def")
.header("Content-Type", "application/json")
.body(StringBody("{\"uid\": \"${UserID}\", \"key1\": \"${key1}\",\"key2\":\"${key2}\"}"))
}
}
`
-Arun