-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_system.sh
More file actions
60 lines (51 loc) · 1.62 KB
/
test_system.sh
File metadata and controls
60 lines (51 loc) · 1.62 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
echo "🧪 Testing Fraud Detection System..."
echo "================================="
# Test 1: API Health Check
echo "1. Testing API Health..."
curl -s http://localhost:5000/health
echo -e "\n"
# Test 2: Generate Sample Data
echo "2. Generating Sample Transactions..."
curl -s -X POST -H "Content-Type: application/json" \
-d '{"count": 5}' \
http://localhost:5000/api/transactions/sample
echo -e "\n"
# Test 3: Create Suspicious Transaction
echo "3. Creating Suspicious Transaction..."
curl -s -X POST -H "Content-Type: application/json" \
-d '{
"amount": 9999,
"user_id": "test_user_suspicious",
"merchant_id": "test_merchant_123",
"transaction_type": "credit_card"
}' \
http://localhost:5000/api/transactions/
echo -e "\n"
# Test 4: Create Normal Transaction
echo "4. Creating Normal Transaction..."
curl -s -X POST -H "Content-Type: application/json" \
-d '{
"amount": 25.50,
"user_id": "test_user_normal",
"merchant_id": "test_merchant_456",
"transaction_type": "upi"
}' \
http://localhost:5000/api/transactions/
echo -e "\n"
# Test 5: View Dashboard Stats
echo "5. Dashboard Statistics..."
curl -s http://localhost:5000/api/dashboard/stats
echo -e "\n"
# Test 6: ML Model Status
echo "6. ML Model Status..."
curl -s http://localhost:5000/api/ml/status
echo -e "\n"
# Test 7: Direct ML Prediction
echo "7. Testing ML Prediction..."
curl -s -X POST -H "Content-Type: application/json" \
-d '{"amount": 5000, "user_id": "test_user"}' \
http://localhost:5000/api/ml/predict
echo -e "\n"
echo "✅ All tests completed!"
echo "🚀 Your fraud detection system is ready for demo!"