package sandbox
import tokens.Tokens
import scala.io.Source
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class CalculateBetslip extends Simulation {
val users = new Tokens
val maxUsers = Integer.getInteger("users", 1)
val placeBets = http .baseURL("host here")
.inferHtmlResources()
.headers(
Map(
"Accept" -> "*/*",
"Authorization" -> users.tokens(0), // <-- I want this to be dynamic for each GATLING user/worker
"ContentType" -> "application/json"
)
)
val headers_0 = Map(
"accept-encoding" -> "gzip, deflate",
"cache-control" -> "no-cache",
"content-length" -> "291")
val placeBetsScenario = scenario("placeBets")
.exec(http("request_0")
.post("/betting/placeBets")
setUp(placeBetsScenario.inject(atOnceUsers(1)).protocols(placeBets)) // Our api holds state, which means that here , when I supply (lets say atOnceUsers(100)) I want to use 100 different tokens but I don't know how
}