110 lines
3.3 KiB
JSON
110 lines
3.3 KiB
JSON
{
|
|
"_comment": "Compatibility Test Suite for API Versioning Manager",
|
|
"api_name": "User Management API",
|
|
"tests": [
|
|
{
|
|
"_comment": "Test case for retrieving user details in version 1",
|
|
"test_name": "Get User Details v1",
|
|
"api_version": "1",
|
|
"endpoint": "/users/123",
|
|
"method": "GET",
|
|
"request_headers": {
|
|
"Accept": "application/json"
|
|
},
|
|
"expected_status_code": 200,
|
|
"expected_response_body": {
|
|
"id": 123,
|
|
"name": "John Doe",
|
|
"email": "john.doe@example.com"
|
|
},
|
|
"backward_compatible_versions": []
|
|
},
|
|
{
|
|
"_comment": "Test case for retrieving user details in version 2",
|
|
"test_name": "Get User Details v2",
|
|
"api_version": "2",
|
|
"endpoint": "/v2/users/123",
|
|
"method": "GET",
|
|
"request_headers": {
|
|
"Accept": "application/json"
|
|
},
|
|
"expected_status_code": 200,
|
|
"expected_response_body": {
|
|
"user_id": 123,
|
|
"full_name": "John Doe",
|
|
"contact_email": "john.doe@example.com",
|
|
"profile_details": {
|
|
"created_at": "2023-10-26T10:00:00Z"
|
|
}
|
|
},
|
|
"backward_compatible_versions": ["1"]
|
|
},
|
|
{
|
|
"_comment": "Test case for creating a user in version 1",
|
|
"test_name": "Create User v1",
|
|
"api_version": "1",
|
|
"endpoint": "/users",
|
|
"method": "POST",
|
|
"request_headers": {
|
|
"Content-Type": "application/json"
|
|
},
|
|
"request_body": {
|
|
"name": "Jane Smith",
|
|
"email": "jane.smith@example.com"
|
|
},
|
|
"expected_status_code": 201,
|
|
"expected_response_body": {
|
|
"id": 456,
|
|
"name": "Jane Smith",
|
|
"email": "jane.smith@example.com"
|
|
},
|
|
"backward_compatible_versions": []
|
|
},
|
|
{
|
|
"_comment": "Test case for creating a user in version 2",
|
|
"test_name": "Create User v2",
|
|
"api_version": "2",
|
|
"endpoint": "/v2/users",
|
|
"method": "POST",
|
|
"request_headers": {
|
|
"Content-Type": "application/json"
|
|
},
|
|
"request_body": {
|
|
"full_name": "Jane Smith",
|
|
"contact_email": "jane.smith@example.com"
|
|
},
|
|
"expected_status_code": 201,
|
|
"expected_response_body": {
|
|
"user_id": 456,
|
|
"full_name": "Jane Smith",
|
|
"contact_email": "jane.smith@example.com"
|
|
},
|
|
"backward_compatible_versions": ["1"]
|
|
},
|
|
{
|
|
"_comment": "Test case for deleting a user in version 1 (deprecated)",
|
|
"test_name": "Delete User v1 (Deprecated)",
|
|
"api_version": "1",
|
|
"endpoint": "/users/123",
|
|
"method": "DELETE",
|
|
"request_headers": {},
|
|
"expected_status_code": 410,
|
|
"expected_response_body": {
|
|
"error": "This endpoint is deprecated. Please use /v2/users/123/deactivate."
|
|
},
|
|
"backward_compatible_versions": [],
|
|
"deprecation_message": "This endpoint is deprecated. Please use /v2/users/123/deactivate."
|
|
},
|
|
{
|
|
"_comment": "Test case for deactivating a user in version 2",
|
|
"test_name": "Deactivate User v2",
|
|
"api_version": "2",
|
|
"endpoint": "/v2/users/123/deactivate",
|
|
"method": "POST",
|
|
"request_headers": {},
|
|
"expected_status_code": 204,
|
|
"expected_response_body": null,
|
|
"backward_compatible_versions": []
|
|
}
|
|
]
|
|
} |