-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-requests.sh
More file actions
executable file
·38 lines (30 loc) · 1.18 KB
/
test-requests.sh
File metadata and controls
executable file
·38 lines (30 loc) · 1.18 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
#!/bin/bash
echo "=== Testing Matching Engine ==="
echo ""
# Add multiple drivers in different locations
echo "1. Adding drivers..."
curl -X POST http://localhost:8080/api/drivers/location \
-H "Content-Type: application/json" \
-d '{"driverId": "driver-001", "latitude": 37.7749, "longitude": -122.4194}'
echo ""
curl -X POST http://localhost:8080/api/drivers/location \
-H "Content-Type: application/json" \
-d '{"driverId": "driver-002", "latitude": 37.7750, "longitude": -122.4190}'
echo ""
curl -X POST http://localhost:8080/api/drivers/location \
-H "Content-Type: application/json" \
-d '{"driverId": "driver-003", "latitude": 37.7760, "longitude": -122.4200}'
echo ""
curl -X POST http://localhost:8080/api/drivers/location \
-H "Content-Type: application/json" \
-d '{"driverId": "driver-004", "latitude": 37.7800, "longitude": -122.4100}'
echo ""
sleep 2
echo ""
echo "2. Searching for nearby driver for a rider..."
curl -X POST http://localhost:8080/api/rides/match \
-H "Content-Type: application/json" \
-d '{"riderId": "rider-001", "latitude": 37.7751, "longitude": -122.4195}'
echo ""
echo ""
echo "3. Done! Check the dashboard at http://localhost:8080/index.html"