-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
6 changed files
with
80 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Define Hurl scripts | ||
HURL_SCRIPTS = leaderboard_post.hurl leaderboard_get.hurl statistic_post.hurl statistic_get.hurl | ||
|
||
# Default target to run all Hurl scripts | ||
all: run_all | ||
|
||
# Target to run leaderboard POST | ||
leaderboard_post: leaderboard_post.hurl | ||
hurl leaderboard_post.hurl | jq . | ||
|
||
# Target to run leaderboard GET | ||
leaderboard_get: leaderboard_get.hurl | ||
hurl leaderboard_get.hurl | jq . | ||
|
||
# Target to run statistic POST | ||
statistic_post: statistic_post.hurl | ||
hurl statistic_post.hurl | jq . | ||
|
||
# Target to run statistic GET | ||
statistic_get: statistic_get.hurl | ||
hurl statistic_get.hurl | jq . | ||
|
||
# Target to run all Hurl scripts | ||
run_all: leaderboard_post leaderboard_get statistic_post statistic_get | ||
|
||
# Clean target to remove .run files | ||
clean: | ||
rm -f *.run |
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,6 @@ | ||
GET http://localhost:8080/api/statistics/leaderboard?limit=10 | ||
|
||
HTTP/1.1 200 | ||
[Asserts] | ||
jsonpath "$[0].userId" exists | ||
jsonpath "$[0].speed" exists |
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,12 @@ | ||
POST http://localhost:8080/api/statistics/leaderboard | ||
Content-Type: application/json | ||
|
||
{ | ||
"userId": "user-1", | ||
"speed": 235.5 | ||
} | ||
|
||
HTTP/1.1 201 | ||
GET http://localhost:8080/api/statistics/leaderboard?limit=10 | ||
|
||
HTTP/1.1 200 |
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,11 @@ | ||
GET http://localhost:8080/api/statistics/user123 | ||
|
||
HTTP/1.1 200 | ||
[Asserts] | ||
jsonpath "$.userId" equals "user123" | ||
jsonpath "$.completedDuels" greaterThanOrEqual 0 | ||
jsonpath "$.averageSpeed" greaterThanOrEqual 0.0 | ||
jsonpath "$.totalReward" greaterThanOrEqual 0.0 | ||
jsonpath "$.overallWinsInDuels" greaterThanOrEqual 0 | ||
jsonpath "$.maxSpeed" greaterThanOrEqual 0.0 | ||
jsonpath "$.topSpeeds" exists |
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,14 @@ | ||
POST http://localhost:8080/api/statistics | ||
Content-Type: application/json | ||
|
||
{ | ||
"userId": "user123", | ||
"completedDuels": 5, | ||
"averageSpeed": 110.2, | ||
"totalReward": 500.0, | ||
"overallWinsInDuels": 3, | ||
"maxSpeed": 120.5, | ||
"topSpeeds": [120.5, 115.3, 110.0, 105.5, 100.0] | ||
} | ||
|
||
HTTP/1.1 201 |
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