{ "name": "API Compliance Tests", "level": "bronze", "description": "Tests for core API compliance", "tests": [ { "id": "BR-001", "name": "Health Check Endpoint", "description": "Validate health check endpoint returns proper response", "request": { "method": "GET", "path": "/health", "headers": { "Accept": "application/json" } }, "expected": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": { "status": "healthy", "timestamp": "string", "version": "string" } } }, { "id": "BR-002", "name": "Authentication - Bearer Token", "description": "Validate bearer token authentication", "request": { "method": "GET", "path": "/api/v1/user/profile", "headers": { "Authorization": "Bearer valid-token", "Accept": "application/json" } }, "expected": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": { "id": "string", "email": "string", "created_at": "string" } } }, { "id": "BR-003", "name": "Authentication - Invalid Token", "description": "Validate proper error for invalid token", "request": { "method": "GET", "path": "/api/v1/user/profile", "headers": { "Authorization": "Bearer invalid-token", "Accept": "application/json" } }, "expected": { "status": 401, "headers": { "Content-Type": "application/json" }, "body": { "error": "AuthenticationError", "message": "string" } } }, { "id": "BR-004", "name": "Create Job - Valid Request", "description": "Validate job creation with valid parameters", "request": { "method": "POST", "path": "/api/v1/jobs", "headers": { "Authorization": "Bearer valid-token", "Content-Type": "application/json" }, "body": { "service_type": "gpu_compute", "spec": { "gpu_type": "A100", "count": 1, "duration": 3600 }, "metadata": { "name": "test-job" } } }, "expected": { "status": 201, "headers": { "Content-Type": "application/json", "Location": "string" }, "body": { "id": "string", "status": "pending", "created_at": "string", "estimated_completion": "string" } } }, { "id": "BR-005", "name": "Create Job - Invalid Parameters", "description": "Validate proper error for invalid job parameters", "request": { "method": "POST", "path": "/api/v1/jobs", "headers": { "Authorization": "Bearer valid-token", "Content-Type": "application/json" }, "body": { "service_type": "invalid_service", "spec": {} } }, "expected": { "status": 400, "headers": { "Content-Type": "application/json" }, "body": { "error": "ValidationError", "message": "string", "details": { "field": "service_type", "issue": "string" } } } }, { "id": "BR-006", "name": "Get Job - Valid ID", "description": "Validate job retrieval with valid ID", "request": { "method": "GET", "path": "/api/v1/jobs/job-123", "headers": { "Authorization": "Bearer valid-token", "Accept": "application/json" } }, "expected": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": { "id": "string", "status": "string", "created_at": "string", "updated_at": "string", "spec": "object", "result": "object|null" } } }, { "id": "BR-007", "name": "Get Job - Not Found", "description": "Validate proper error for non-existent job", "request": { "method": "GET", "path": "/api/v1/jobs/nonexistent", "headers": { "Authorization": "Bearer valid-token", "Accept": "application/json" } }, "expected": { "status": 404, "headers": { "Content-Type": "application/json" }, "body": { "error": "NotFoundError", "message": "string" } } }, { "id": "BR-008", "name": "List Jobs - With Pagination", "description": "Validate job listing with pagination", "request": { "method": "GET", "path": "/api/v1/jobs?limit=10&offset=0", "headers": { "Authorization": "Bearer valid-token", "Accept": "application/json" } }, "expected": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": { "jobs": "array", "total": "number", "limit": "number", "offset": "number", "has_more": "boolean" } } }, { "id": "BR-009", "name": "Error Response Format", "description": "Validate consistent error response format", "request": { "method": "POST", "path": "/api/v1/invalid-endpoint", "headers": { "Authorization": "Bearer valid-token" } }, "expected": { "status": 404, "headers": { "Content-Type": "application/json" }, "body": { "error": "string", "message": "string", "request_id": "string" } } }, { "id": "BR-010", "name": "Rate Limit Headers", "description": "Validate rate limit headers are present", "request": { "method": "GET", "path": "/api/v1/jobs", "headers": { "Authorization": "Bearer valid-token" } }, "expected": { "status": 200, "headers": { "X-RateLimit-Limit": "string", "X-RateLimit-Remaining": "string", "X-RateLimit-Reset": "string" } } } ] }