-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.sh
More file actions
46 lines (40 loc) · 1.14 KB
/
Copy pathtest_api.sh
File metadata and controls
46 lines (40 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# This script tests the survey response submission API
# Wait for the server to start
echo "Waiting for server to start..."
sleep 5
# Submit a survey response
echo "Submitting survey response..."
curl -X POST http://localhost:8080/api/survey/submit \
-H "Content-Type: application/json" \
-d '{
"survey_id": "survey123",
"answers": {
"question1": "answer1",
"question2": "answer2",
"question3": "answer3"
}
}'
echo -e "\n\nSubmitting another response for the same survey (should be debounced)..."
curl -X POST http://localhost:8080/api/survey/submit \
-H "Content-Type: application/json" \
-d '{
"survey_id": "survey123",
"answers": {
"question1": "different answer",
"question2": "different answer",
"question3": "different answer"
}
}'
echo -e "\n\nSubmitting response for a different survey..."
curl -X POST http://localhost:8080/api/survey/submit \
-H "Content-Type: application/json" \
-d '{
"survey_id": "survey456",
"answers": {
"question1": "answer1",
"question2": "answer2",
"question3": "answer3"
}
}'
echo -e "\n\nTest completed."