Need example showing assertions that fail a simulation

Are there any full examples of how to use the Assertions functionality? I’m trying to get a simulation to appear to be failed so that maven will fail as well, but get compiler errors when using the below (or when I move assertThat to other lines). Thanks


package basic

import com.excilys.ebi.gatling.core.Predef._

import com.excilys.ebi.gatling.http.Predef._

import com.excilys.ebi.gatling.jdbc.Predef._

import com.excilys.ebi.gatling.http.Headers.Names._

import akka.util.duration._

import bootstrap._


class basic extends Simulation {

val httpConf = httpConfig




.requestInfoExtractor( (request: Request) => { ListString } )

.responseInfoExtractor( (response: Response) => { ListString } )

val scn = scenario(“Scenario name”)










Console Output

You’re using the assertions correctly but,
in order to use the Assertions API, you need to import assertions._ in your simulation.

Simply add :

import assertions._

after the others imports and it should work!

There is currently no assertions in our simulation examples, I’ll fix that shortly.

@Pierre: Can you also mention this in the migration guide, please?

Worked like a charm. Thanks!

It would be great to have it on the wiki page as well


Wow, that’s fast. :slight_smile: Thanks!