- Maven 3
- JDK 21
- K6 (install according to manual)
- Get candidates (should be read from JSON file during app start)
- Make vote (by passport id) (no double vote allowed)
- Get voting results
mvn clean install
Use run.bat
script in project root folder or use docker-compose:
docker-compose up
http://localhost:8090/swagger-ui/index.html
curl http://localhost:8090/candidates
curl http://localhost:8090/votings
curl http://localhost:8090/votings/3
curl -i -X POST http://localhost:8090/votings/3 \
-H "Content-Type: application/json" \
-d "{ \"passportId\": \"MP345353634547\"}"
curl -i -X DELETE http://localhost:8090/votings
cd func-test
./gradlew clean build
Check tests report at ./func-test/build/spock-reports/index.html
cd load-test
k6 run script.js
Start InfluxDB and Grafana (according to https://k6.io/blog/k6-loves-grafana/)
git clone https://github.com/grafana/k6 && cd k6
git submodule update --init
docker-compose up -d influxdb grafana
Grafana available via http://localhost:3000
Add datasource with next params:
URL: http://localhost:8086 Access: Browser Database: mydb HTTP Method: GET
k6 run -o influxdb=http://localhost:8086/mydb script.js