Greetings,
I’m trying to use doIf() to execute a single step in the scenario once. Unfortunately, the documented syntax is not working. No doubt, I’ve missed something obvious…
Compiler error:
Error:(21, 9) not found: value exec
exec( Doorman.configs.generate.httpPost )
^
package com.taketwo.mytwok.gatling.simulations
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.taketwo.mytwok.gatling.core.{AppContext, Common, Properties}
import com.taketwo.mytwok.gatling.services.{Sso, Doorman}
class EchoSimulation extends Simulation {
val url = Common.Url(Properties.entitlements.url)
val name = “grants.echo”
def echo = {
Common.httpPost(name, url, AppContext())
.check(status.is(200))
}
setUp(
scenario(“my2k-echo”)
.feed( Sso.platformFeeder )
.doIf( (session: Session) => { ! session.isAttributeDefined(“access_token”) } ) {
exec( Doorman.configs.generate.httpPost )
}
.exec( echo )
.protocolConfig(Common.httpConf)
.users(Properties.sim.userCount)
.ramp(Properties.sim.userRamp)
)
}