Add test file
This commit is contained in:
parent
09ccd2ec5a
commit
b3835b2340
1 changed files with 23 additions and 0 deletions
23
test.sh
Executable file
23
test.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
baseurl="http://localhost:8080/titamaApi/v1"
|
||||||
|
header="Content-Type: application/json"
|
||||||
|
new_course_data='{"title": "FIN Sitzung", "day": "Wed", "time": "18:00"}'
|
||||||
|
|
||||||
|
printf "Testing %s/courses...\n" "$baseurl"
|
||||||
|
curl "$baseurl/courses"
|
||||||
|
|
||||||
|
printf "\n\nTesting %s/course/0...\n" "$baseurl"
|
||||||
|
curl "$baseurl/course/0"
|
||||||
|
|
||||||
|
printf "\n\nTesting %s/course/1...\n" "$baseurl"
|
||||||
|
curl "$baseurl/course/1"
|
||||||
|
|
||||||
|
printf "\n\nTesting %s/course...\n" "$baseurl"
|
||||||
|
curl -d "$new_course_data" -H "$header" $baseurl/course
|
||||||
|
|
||||||
|
printf "\n\nTesting %s/courses...\n" "$baseurl"
|
||||||
|
curl "$baseurl/courses"
|
||||||
|
|
||||||
|
printf "\n\nTesting %s/course/2...\n" "$baseurl"
|
||||||
|
curl "$baseurl/course/2"
|
Reference in a new issue