Skip to content

Commit d660257

Browse files
committed
[SCALA-568] Point gatling to a scala REST API
1 parent 3d19540 commit d660257

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

scala-gatling/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
- [Testing With Gatling Using Scala]()
33

44
### Gatling Executions
5-
compile tests: `sbt test:compile`
6-
then run the simulation: `sbt 'Gatling/testOnly com.baeldung.gatling.PeakLoadSimulation'`
5+
From this module's folder, we first compile tests: `sbt test:compile`
6+
7+
Then run the simulation: `sbt 'Gatling/testOnly com.baeldung.gatling.PeakLoadSimulation'`
8+
9+
**Notes**: in order to spin-up the right API this example uses, we also need to start the server:
10+
`sbt resApi/run` from root folder

scala-gatling/src/test/scala/com/baeldung/gatling/PeakLoadSimulation.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ class PeakLoadSimulation extends Simulation {
99
setUp(
1010
getScenario(
1111
"getExistingEndpoint",
12-
simpleRequest("request_status_endpoint", "/health/status", 200),
12+
simpleRequest("request_status_endpoint", "/todo", 200),
1313
50,
1414
10,
1515
60
1616
),
1717
getScenario(
1818
"nonExistingEndpoint",
19-
simpleRequest("request_wrong_endpoint", "/health/status1", 200),
19+
simpleRequest("request_wrong_endpoint", "/not-todo", 200),
2020
5,
2121
10,
2222
60

scala-gatling/src/test/scala/com/baeldung/gatling/ScenariosProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import scala.language.postfixOps
99
object ScenariosProvider {
1010

1111
private val httpProtocol =
12-
http.baseUrl("http://localhost:8080").disableCaching.disableFollowRedirect
12+
http.baseUrl("http://localhost:9000").disableCaching.disableFollowRedirect
1313

1414
def getScenario(
1515
scenarioName: String,

0 commit comments

Comments
 (0)