Files
smart-asset-test-Frank/e2e.sh
Roman 26c4b1eb26 quick end-to-end test
And some bug fixes too!
2026-07-01 13:13:39 +02:00

53 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
BASE_URL="http://localhost:8080/api"
echo "=== E2E Pseudo Test ==="
echo ""
echo "POST /api/orderupdate - Place SELL order"
curl -s -X POST "$BASE_URL/orderupdate" \
-H "Content-Type: application/json" \
-d '{
"delivery_start_time": "2024-01-15T10:00:00",
"delivery_end_time": "2024-01-15T10:15:00",
"order_side": "SELL",
"quantity": 10,
"price": 50.00
}' | jq .
echo ""
echo "POST /api/orderupdate - Place matching BUY order"
curl -s -X POST "$BASE_URL/orderupdate" \
-H "Content-Type: application/json" \
-d '{
"delivery_start_time": "2024-01-15T10:00:00",
"delivery_end_time": "2024-01-15T10:15:00",
"order_side": "BUY",
"quantity": 5,
"price": 50.00
}' | jq .
echo ""
echo "POST /api/orderupdate - Place another SELL order"
curl -s -X POST "$BASE_URL/orderupdate" \
-H "Content-Type: application/json" \
-d '{
"delivery_start_time": "2024-01-15T10:15:00",
"delivery_end_time": "2024-01-15T10:30:00",
"order_side": "SELL",
"quantity": 20,
"price": 45.00
}' | jq .
echo ""
echo "GET /api/market/overview - Get market overview"
curl -s -X GET "$BASE_URL/market/overview" | jq .
echo ""
echo "GET /api/purchases/average - Get average purchase price"
curl -s -X GET "$BASE_URL/purchases/average" | jq .
echo ""
echo "=== Done ==="