Last active
January 3, 2016 11:29
-
-
Save aghuddleston/8456857 to your computer and use it in GitHub Desktop.
A Gatling-tool test case that does create/update/delete on an object, using the session userId as part of the object id. Using gatling-1.5.3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mypackage | |
import com.excilys.ebi.gatling.core.Predef._ | |
import com.excilys.ebi.gatling.http.Predef._ | |
import com.excilys.ebi.gatling.http.Headers.Names._ | |
import akka.util.duration._ | |
import bootstrap._ | |
object Department { | |
val departmentScn = scenario("Department CRUD") | |
.exec( | |
http("Create Department") | |
.get("/department/add") | |
.queryParam("parameters", (s:Session) => """[{"departmentName":"Perf Test Department","departmentCode":"PerfDept"""+s.userId.toString+"""","initiatorId":"MyIdHere"}]""") | |
.check(status.is(200)) | |
) | |
.pause(0 milliseconds, 5 milliseconds) | |
.exec ( | |
http("Update Department") | |
.get("/department/update") | |
.queryParam("parameters", (s:Session) => """[{"departmentName":"Update name","departmentCode":"PerfDept"""+s.userId.toString+"""","initiatorId":"MyIdHere"}]""") | |
.check(status.is(200)) | |
) | |
.pause(0 milliseconds, 5 milliseconds) | |
.exec ( | |
http("Delete Department") | |
.get("/department/delete") | |
.queryParam("parameters", (s:Session) => """[{"departmentCode":"PerfDept"""+s.userId.toString+"""","initiatorId":"MyIdHere"}]""") | |
.check(status.is(200)) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment