# Assertions with gatling 2.0.0-M3a

**URL:** <https://community.gatling.io/t/assertions-with-gatling-2-0-0-m3a/607>\
**Category:** Gatling (Open-Source)\
**Created:** [October 3, 2013, 6:37pm UTC](https://community.gatling.io/t/assertions-with-gatling-2-0-0-m3a/607 "2013-10-03T18:37:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![softmentor](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@softmentor](https://community.gatling.io/u/softmentor)\
**Post date:** [October 3, 2013, 6:37pm UTC](https://community.gatling.io/t/assertions-with-gatling-2-0-0-m3a/607/1 "2013-10-03T18:37:19Z")

</div>

I am getting the following when trying out the assertions, any idea what I could be missing out here (using 2.0.0-M3a):

[https://github.com/softmentor/gatling-examples/blob/master/gatling-custom-protocol-demo/src/test/scala/custom/protocol/test/TestCustomProtocolSimulation.scala](https://github.com/softmentor/gatling-examples/blob/master/gatling-custom-protocol-demo/src/test/scala/custom/protocol/test/TestCustomProtocolSimulation.scala)

I have done import and assertThat (as per the documentation)  
_import assertions.\__

…

_assertThat(_  
_global.responseTime.max.lessThan(50),_  
_global.successfulRequest.percent.greaterThan(95))_

You can run the whole example here:  
[https://github.com/softmentor/gatling-examples](https://github.com/softmentor/gatling-examples)

Exception when I run: _mvn clean test_

23:51:32.886 [ERROR] i.g.a.ZincCompiler$ - /softmentor/gatling-examples/gatling-custom-protocol-demo/src/test/scala/custom/protocol/test/TestCustomProtocolSimulation.scala:34: not found: value assertThat  
23:51:32.888 [ERROR] i.g.a.ZincCompiler$ - assertThat(  
23:51:32.889 [ERROR] i.g.a.ZincCompiler$ - ^  
23:51:33.497 [ERROR] i.g.a.ZincCompiler$ - one error found  
Exception in thread “main” Compilation failed  
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:105)  
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:48)  
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)  
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:98)  
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:98)  
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:98)  
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:155)  
at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:97)  
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:138)  
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:86)  
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:30)  
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:28)  
at sbt.inc.Incremental$.cycle(Incremental.scala:73)  
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:33)  
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:32)  
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:41)  
at sbt.inc.Incremental$.compile(Incremental.scala:32)  
at sbt.inc.IncrementalCompile$.apply(Compile.scala:25)  
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:146)  
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)  
at com.typesafe.zinc.Compiler.compile(Compiler.scala:161)  
at com.typesafe.zinc.Compiler.compile(Compiler.scala:142)  
at io.gatling.app.ZincCompiler$.main(ZincCompiler.scala:111)  
at io.gatling.app.ZincCompiler.main(ZincCompiler.scala)  
java.lang.reflect.InvocationTargetException  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:606)  
at scala\_maven\_executions.MainHelper.runMain(MainHelper.java:164)  
at scala\_maven\_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)  
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)  
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)  
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)  
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:147)  
at io.gatling.app.ZincCompilerLauncher$.apply(ZincCompilerLauncher.scala:54)  
at io.gatling.app.SimulationClassLoader$.fromSourcesDirectory(SimulationClassLoader.scala:32)  
at io.gatling.app.Gatling$$anonfun$15.apply(Gatling.scala:171)  
at io.gatling.app.Gatling$$anonfun$15.apply(Gatling.scala:171)  
at scala.Option.getOrElse(Option.scala:120)  
at io.gatling.app.Gatling.start(Gatling.scala:171)  
at io.gatling.app.Gatling$.fromMap(Gatling.scala:59)  
at io.gatling.app.Gatling$.runGatling(Gatling.scala:80)  
at io.gatling.app.Gatling$.main(Gatling.scala:54)  
at io.gatling.app.Gatling.main(Gatling.scala)  
… 6 more

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [October 3, 2013, 6:45pm UTC](https://community.gatling.io/t/assertions-with-gatling-2-0-0-m3a/607/2 "2013-10-03T18:45:07Z")

</div>

Hi,

This changed in M3: [https://github.com/excilys/gatling/wiki/Gatling-2#wiki-assertions](https://github.com/excilys/gatling/wiki/Gatling-2#wiki-assertions)

Note that we have a test class that’s not intended to run, but just to check that everything compiles fine: [https://github.com/excilys/gatling/blob/2.0.0-M3a/gatling-app/src/test/scala/io/gatling/app/test/CompileTest.scala#L205](https://github.com/excilys/gatling/blob/2.0.0-M3a/gatling-app/src/test/scala/io/gatling/app/test/CompileTest.scala#L205)

Cheers,

Stéphane

---

<div class="post-metadata">

**Author:** ![softmentor](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@softmentor](https://community.gatling.io/u/softmentor)\
**Post date:** [October 4, 2013, 5:33pm UTC](https://community.gatling.io/t/assertions-with-gatling-2-0-0-m3a/607/3 "2013-10-04T17:33:09Z")

</div>

Perfect, it worked.  
I fixed my example also.  
[https://github.com/softmentor/gatling-examples/blob/master/gatling-custom-protocol-demo/src/test/scala/custom/protocol/test/TestCustomProtocolSimulation.scala](https://github.com/softmentor/gatling-examples/blob/master/gatling-custom-protocol-demo/src/test/scala/custom/protocol/test/TestCustomProtocolSimulation.scala)

Cheers,  
softmentor
