-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-integration.sh
More file actions
60 lines (51 loc) · 1.69 KB
/
test-integration.sh
File metadata and controls
60 lines (51 loc) · 1.69 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
# DataCoreX Integration Testing Script
# This script tests all major API endpoints
# Configuration
BASE_URL="http://localhost:8081"
ORG_EMAIL="test@example.com"
ORG_PASSWORD="example-password"
API_KEY="dcx_EXAMPLE_API_KEY_FOR_TESTING"
echo "=== DataCoreX Integration Testing ==="
echo "- Base URL: $BASE_URL"
echo "- Organization Email: $ORG_EMAIL"
echo "- API Key: $API_KEY"
# Test 1: Health Check
echo "🔍 Test 1: Health Check"
curl -s "$BASE_URL/api/health" | head -3
echo ""
echo ""
# Test 2: Organization Login
echo "🔍 Test 2: Organization Login"
ORG_RESPONSE=$(curl -s -X POST "$BASE_URL/api/organization/login" \
-H "Content-Type: application/json" \
-d "{\"email\":\"$ORG_EMAIL\",\"password\":\"$ORG_PASSWORD\"}")
echo "$ORG_RESPONSE" | head -3
echo ""
echo ""
# Test 3: User Registration (for your website users)
echo "🔍 Test 3: User Registration"
USER_RESPONSE=$(curl -s -X POST "$BASE_URL/api/auth/register" \
-H "Content-Type: application/json" \
-d '{"username":"testwebuser","email":"testuser@yoursite.com","password":"example-password","role":"USER"}')
echo "$USER_RESPONSE" | head -3
echo ""
echo ""
# Test 4: API Welcome
echo "🔍 Test 4: API Welcome"
curl -s "$BASE_URL/api/" | head -3
echo ""
echo ""
# Test 5: API Documentation
echo "🔍 Test 5: API Documentation Access"
curl -s "$BASE_URL/api-docs" | head -1
echo ""
echo ""
echo "✅ Integration tests completed!"
echo ""
echo "📖 Full integration guide created at: integration-guide.md"
echo "🌐 API Documentation: $BASE_URL/api-docs"
echo "💾 H2 Database Console: $BASE_URL/h2-console"
echo "📊 Application Dashboard: $BASE_URL/"
echo ""
echo "Your DataCoreX BaaS platform is ready for website integration! 🎉"