Add test file

This commit is contained in:
Marcel Kapfer (mmk2410) 2016-06-18 23:42:10 +02:00
parent 09ccd2ec5a
commit b3835b2340

23
test.sh Executable file
View 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"