- Modify a REST API's body and/or query with strings from the big list of naughty strings and check for the expected response code.
- The list has over 1k strings, which can be slow, so run tests concurrently using the gatling load-test framework.
- ./build.sh
- See config defaults in Config.scala
- CLI examples in test.sh.
- In the
query
orbody
, any strings surrounded by${}
and specified as thetarget
value will be replaced by a string from the big list.
- run Engine.scala
- Project layout is based off gatling's defaults
docker run -it --rm mvngatimage java \
-Dpath="http://localhost:3001/user" \
-Dmethod=POST \
-Dbody='"{"username":"${custom}", "password":"${custom}"}' \
-Dtarget=custom \
-cp target/string-tests-1.0-SNAPSHOT.jar io.gatling.app.Gatling -s config.testSim
docker run -it --rm mvngatimage java \
-Dpath="http://localhost:3001/users" \
-Dmethod=GET \
-Dquery='?name=${custom}' \
-Dtarget=custom \
-cp target/string-tests-1.0-SNAPSHOT.jar io.gatling.app.Gatling -s config.testSim
docker run -it --rm mvngatimage java \
-Dauth=true \
-Dauth_path="http://localhost:3001/sign-in" \
-Dauth_method=POST \
-Dauth_body='"{"username":"${custom}", "password":"${custom}"}' \
-Dauth_query='?username=${custom}&password=${custom}' \
-Dauth_expRspCode=500 \
-Dpath="http://localhost:3001/users" \
-Dmethod=GET \
-Dquery='?name=${custom}' \
-Dtarget=custom \
-cp target/string-tests-1.0-SNAPSHOT.jar io.gatling.app.Gatling -s config.testSim
docker run -it --rm mvngatimage java \
-Dpath="http://localhost:3001/users" \
-Dmethod=GET \
-Dquery='?name=${custom}' \
-Dtarget=custom \
-Dthreads=500
-cp target/string-tests-1.0-SNAPSHOT.jar io.gatling.app.Gatling -s config.testSim