```json
{
"tests": [
{
"name": "test_otp_request",
"endpoint": "/auth/otp",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"payload": {
"email": "test@example.com"
},
"expected_status": 200,
"expected_behavior": "Returns success message for OTP request",
"metrics": ["latency", "status_code", "response_time"],
"validation": {
"check_response_structure": true,
"expect_json": true
}
},
{
"name": "test_login_structure",
"endpoint": "/auth/login",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"payload": {
"email": "test@example.com",
"otp_code": "123456"
},
"expected_status": [400, 401, 422],
"expected_behavior": "Returns error for invalid OTP (tests endpoint structure)",
"metrics": ["latency", "error_handling", "status_code"],
"validation": {
"expect_json": true,
"check_error_format": true
}
},
{
"name": "test_applications_submit_unauthorized",
"endpoint": "/applications",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"payload": {
"email": "citizen@example.com",
"first_name": "John",
"last_name": "Doe",
"popup_city_id": 1
},
"expected_status": [401, 403],
"expected_behavior": "Returns unauthorized error without valid token",
"metrics": ["latency", "error_handling", "status_code"],
"validation": {
"expect_json": true,
"check_auth_required": true
}
},
{
"name": "test_applications_query",
"endpoint": "/applications",
"method": "GET",
"headers": {
"Content-Type": "application/json"
},
"payload": {},
"expected_status": [200, 401, 403],
"expected_behavior": "Returns applications or auth error",
"metrics": ["latency", "status_code"],
"validation": {
"expect_json": true
}
},
{
"name": "test_applications_query_with_params",
"endpoint": "/applications?popup_city_id=1",
"method": "GET",
"headers": {
"Content-Type": "application/json"
},
"payload": {},
"expected_status": [200, 401, 403],
"expected_behavior": "Returns filtered applications or auth error",
"metrics": ["latency", "status_code"],
"validation": {
"expect_json": true
}
},
{
"name": "test_invalid_endpoint",
"endpoint": "/nonexistent",
"method": "GET",
"headers": {},
"payload": {},
"expected_status": 404,
"expected_behavior": "Returns 404 for invalid endpoints",
"metrics": ["error_handling", "status_code"],
"validation": {
"expect_404": true
}
},
{
"name": "test_otp_missing_email",
"endpoint": "/auth/otp",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"payload": {},
"expected_status": [400, 422],
"expected_behavior": "Returns validation error for missing required field",
"metrics": ["error_handling", "status_code"],
"validation": {
"expect_json": true,
"check_validation_error": true
}
},
{
"name": "test_application_invalid_data",
"endpoint": "/applications",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"payload": {
"email": "invalid-email",
"popup_city_id": "not-a-number"
},
"expected_status": [400, 422],
"expected_behavior": "Returns validation error for invalid data types",
"metrics": ["error_handling", "status_code"],
"validation": {
"expect_json": true,
"check_validation_error": true
}
}
],
"pricing_probes": [
{
"name": "check_rate_limit_headers",
"description": "Check if API returns rate limiting headers",
"endpoint": "/auth/otp",
"method": "POST",
"payload": {
"email": "test@example.com"
},
"check": "response.headers should include rate limiting info like X-RateLimit-*"
},
{
"name": "verify_usage_tracking",
"description": "Check if API tracks usage in response headers or body",
"endpoint": "/applications",
"method": "GET",
"payload": {},
"check": "response.headers or body should indicate usage tracking"
}
],
"stress_profile": {
"concurrent_requests": 3,
"duration_seconds": 8,
"ramp_up": true,
"max_rpm": 50,
"note": "Respecting 60 RPM limit with safety margin"
}
}
```