Created
September 4, 2014 17:00
-
-
Save anonymous/bb2b2a4a3ad87ea9c647 to your computer and use it in GitHub Desktop.
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 harpia | |
import io.gatling.core.Predef._ | |
import io.gatling.core.session._ | |
import io.gatling.core.structure.ConditionalStatements | |
import io.gatling.http.Predef._ | |
import io.gatling.http.request.StringBody | |
import scala.concurrent.duration._ | |
import harpia._ | |
class Startup extends Simulation { | |
val feederConfig = csv("enviroment-config.csv").circular | |
val scn = scenario("Insertions") // Cria o database | |
.feed(feederConfig) | |
.exec(http("createDB") | |
.post("/v1/databases") | |
.body(StringBody("""{ "database_name" : "${database}" }""")).asJSON | |
.check(status.is(201).saveAs("crieted")) | |
.check(jsonPath("$..Invalid Request").saveAs("exist")) | |
).doIfOrElse("${criated}") { | |
//println("Database created.") | |
exec(http("Database created").get("/v1/imports")) | |
} | |
setUp (scn.inject(atOnceUsers(1)) | |
.protocols(GoGEOProtocols.ApiServer)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment