-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
392f928
commit 254ddd7
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
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
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
28 changes: 28 additions & 0 deletions
28
src/test/java/com/github/jaguililla/appointments/GatlingSimulation.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.jaguililla.appointments; | ||
|
||
import static io.gatling.javaapi.core.CoreDsl.*; | ||
import static io.gatling.javaapi.http.HttpDsl.*; | ||
|
||
import io.gatling.javaapi.core.*; | ||
import io.gatling.javaapi.http.*; | ||
|
||
public class GatlingSimulation extends Simulation { | ||
|
||
String baseUrl = "http://localhost:18080"; | ||
|
||
ChainBuilder appointmentsCrud = exec( | ||
http("Create").post("/appointments").check(status().is(201)), | ||
pause(1), | ||
http("Read").get("/appointments").check(status().is(200)), | ||
pause(1), | ||
http("Delete").delete("/appointments").check(status().is(200)), | ||
pause(1) | ||
); | ||
|
||
HttpProtocolBuilder httpProtocol = http.baseUrl(baseUrl); | ||
ScenarioBuilder users = scenario("Appointments").exec(appointmentsCrud); | ||
|
||
{ | ||
setUp(users.injectOpen(rampUsers(10).during(10))).protocols(httpProtocol); | ||
} | ||
} |