{ "start_time": "2025-06-20T10:38:16.672560", "end_time": "2025-06-20T10:38:53.355720", "duration_seconds": "36.68", "overall_summary": { "total_endpoints_defined": 6, "endpoints_tested": 6, "endpoints_passed": 0, "endpoints_failed": 6, "endpoints_error": 0, "endpoints_skipped": 0, "endpoints_partial_success": 0, "endpoint_success_rate": "0.00%", "total_test_cases_applicable": 108, "total_test_cases_executed": 108, "test_cases_passed": 79, "test_cases_failed": 29, "test_cases_error": 0, "test_cases_skipped_in_endpoint": 0, "test_case_success_rate": "73.15%", "total_stages_defined": 1, "total_stages_executed": 1, "stages_passed": 0, "stages_failed": 1, "stages_error": 0, "stages_skipped": 0, "stage_success_rate": "0.00%" }, "errors": [], "endpoint_results": [ { "endpoint_id": "POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}", "endpoint_name": "数据推送接口", "overall_status": "失败", "duration_seconds": 4.707823, "start_time": "2025-06-20T10:38:16.674466", "end_time": "2025-06-20T10:38:21.382289", "executed_test_cases": [ { "test_case_id": "TC-HEADER-001", "test_case_name": "必需请求头Schema验证", "test_case_severity": "严重", "status": "失败", "message": "缺少必需的请求头 X-Tenant-ID;缺少必需的请求头 X-Data-Domain", "duration_seconds": 0.5419976249686442, "timestamp": "2025-06-20T10:38:17.216787", "validation_points": [ { "header": "X-Tenant-ID", "possible_names": [ "X-Tenant-ID" ], "endpoint": "POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}" }, { "header": "X-Data-Domain", "possible_names": [ "X-Data-Domain" ], "endpoint": "POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}" } ] }, { "test_case_id": "TC-STATUS-001", "test_case_name": "基本状态码 200 检查", "test_case_severity": "严重", "status": "通过", "message": "响应状态码为 200,符合预期 200。", "duration_seconds": 0.05843891599215567, "timestamp": "2025-06-20T10:38:17.275470", "validation_points": [ { "passed": true, "message": "响应状态码为 200,符合预期 200。" } ] }, { "test_case_id": "TC-SECURITY-002", "test_case_name": "敏感字段加密检查", "test_case_severity": "高", "status": "通过", "message": "未在响应中找到需要检查的敏感字段。", "duration_seconds": 0.06720204197335988, "timestamp": "2025-06-20T10:38:17.342818", "validation_points": [ { "passed": true, "message": "未在响应中找到需要检查的敏感字段。" } ] }, { "test_case_id": "TC-LLM-COMPLIANCE-001", "test_case_name": "LLM合规性综合检查", "test_case_severity": "中", "status": "通过", "message": "[API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除] 通过: 当前API调用使用了POST方法,且根据URL和路径参数判断,该操作涉及创建或推送消息(/message/push),符合POST方法的语义。", "duration_seconds": 3.5183457499952056, "timestamp": "2025-06-20T10:38:20.861385", "validation_points": [ { "criterion": "API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除", "llm_reason": "当前API调用使用了POST方法,且根据URL和路径参数判断,该操作涉及创建或推送消息(/message/push),符合POST方法的语义。" } ] }, { "test_case_id": "TC-RESTful-001", "test_case_name": "核心命名与结构规范检查", "test_case_severity": "高", "status": "通过", "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。;规范中未找到响应码 200 或其类别(2XX, default)的匹配定义,跳过空数组与null的检查。", "duration_seconds": 0.09073545801220462, "timestamp": "2025-06-20T10:38:20.952383", "validation_points": [ { "passed": true, "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。" }, { "passed": true, "message": "规范中未找到响应码 200 或其类别(2XX, default)的匹配定义,跳过空数组与null的检查。" } ] }, { "test_case_id": "TC-DMS-PAGINATION-001", "test_case_name": "分页参数检查", "test_case_severity": "中", "status": "通过", "message": "跳过检查:API不符合分页参数检查的准入规则(需包含'查询'/'列表'等关键词,且不包含'详情'等关键词)", "duration_seconds": 0.03268224996281788, "timestamp": "2025-06-20T10:38:20.985193", "validation_points": [ { "path": "/api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}", "method": "POST", "summary": "数据推送接口", "contains_include_keyword": false, "contains_exclude_keyword": false } ] }, { "test_case_id": "TC-RESTful-002", "test_case_name": "资源路径名词检查", "test_case_severity": "中", "status": "通过", "message": "路径 '/api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 符合资源名词命名规范。", "duration_seconds": 0.03199870901880786, "timestamp": "2025-06-20T10:38:21.017734", "validation_points": [ { "passed": true, "message": "路径 '/api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 符合资源名词命名规范。" } ] }, { "test_case_id": "TC-DMS-CORE-SCHEMA-001", "test_case_name": "DMS核心存储服务API响应格式检查", "test_case_severity": "高", "status": "通过", "message": "字段'code'在schema中未标记为必填(required);字段'message'在schema中未标记为必填(required);字段'data'在schema中未标记为必填(required);响应schema符合标准格式: {'code':int or number or string, 'message':string, 'data': any}", "duration_seconds": 0.04492170800222084, "timestamp": "2025-06-20T10:38:21.063043", "validation_points": [ { "status_code": "201", "required_fields": [] }, { "status_code": "201", "required_fields": [] }, { "status_code": "201", "required_fields": [] }, { "status_code": "201" } ] }, { "test_case_id": "TC-CORE-FUNC-001", "test_case_name": "Response Body JSON Schema Validation", "test_case_severity": "严重", "status": "通过", "message": "Schema验证步骤完成(未发现问题,或schema不适用/未为此响应定义)。", "duration_seconds": 0.036558291991241276, "timestamp": "2025-06-20T10:38:21.099819", "validation_points": [ { "passed": true, "message": "Schema验证步骤完成(未发现问题,或schema不适用/未为此响应定义)。" } ] }, { "test_case_id": "TC-RESTful-003", "test_case_name": "时间字段ISO 8601格式检查", "test_case_severity": "中", "status": "通过", "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。", "duration_seconds": 0.03229362500132993, "timestamp": "2025-06-20T10:38:21.132401", "validation_points": [ { "passed": true, "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。" } ] }, { "test_case_id": "TC-DMS-URL-VERSION-001", "test_case_name": "DMS API URL版本号检查", "test_case_severity": "中", "status": "通过", "message": "API路径 '/api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 正确以'/api/'开头;API路径 '/api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 包含版本标识: 'v1'", "duration_seconds": 0.03511912497924641, "timestamp": "2025-06-20T10:38:21.167789", "validation_points": [ { "full_path": "/api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}" }, { "pattern_matched": "/v\\d+/", "version_string": "v1", "full_path": "/api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}" } ] }, { "test_case_id": "TC-SECURITY-001", "test_case_name": "HTTPS Protocol Mandatory Verification", "test_case_severity": "严重", "status": "失败", "message": "API通过HTTP (http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/message/push/example_schema/example_version) 响应了成功的状态码 200,这违反了HTTPS强制策略。", "duration_seconds": 0.03721991699421778, "timestamp": "2025-06-20T10:38:21.205590", "validation_points": [ { "status_code": 200 } ] }, { "test_case_id": "TC-ERROR-4001-QUERY", "test_case_name": "Error Code -1 - Query Parameter Type Mismatch Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:在查询参数中未找到合适的字段来测试类型不匹配。", "duration_seconds": 0.029320540954358876, "timestamp": "2025-06-20T10:38:21.235016", "validation_points": [ { "passed": true, "message": "跳过测试:在查询参数中未找到合适的字段来测试类型不匹配。" } ] }, { "test_case_id": "TC-ERROR-4001-BODY", "test_case_name": "Error Code -1 - Request Body Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当请求体字段 'isSearchCount' 类型不匹配时, 业务错误码应为 -1,但实际为 4006。", "duration_seconds": 0.026112249994184822, "timestamp": "2025-06-20T10:38:21.261221", "validation_points": [ { "expected_code": -1, "actual_code": 4006, "response_body": { "code": 4006, "message": "est officia in sit culpa", "data": { "total": 15, "list": [ { "dsid": "97", "dataRegion": "ullamco est irure quis in", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null, "key": 123 } ] } } } ] }, { "test_case_id": "TC-ERROR-4002", "test_case_name": "Error Code -1 - Number Value Out of Range Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确范围限制的数值字段。", "duration_seconds": 0.02648395800497383, "timestamp": "2025-06-20T10:38:21.287809", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确范围限制的数值字段。" } ] }, { "test_case_id": "TC-ERROR-4006", "test_case_name": "Error Code 4006 - Invalid Enum Value Validation", "test_case_severity": "中", "status": "失败", "message": "当 body 字段 'logic' 值为 'invalid_enum_8j5lv9' (合法值为: ['AND', 'OR']) 时, 业务错误码应为 -1,但实际为 4006。", "duration_seconds": 0.03137775004142895, "timestamp": "2025-06-20T10:38:21.319286", "validation_points": [ { "expected_code": -1, "actual_code": 4006, "response_body": { "code": 4006, "message": "est officia in sit culpa", "data": { "total": 15, "list": [ { "dsid": "97", "dataRegion": "ullamco est irure quis in", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null, "key": 123 } ] } } } ] }, { "test_case_id": "TC-ERROR-4003-BODY", "test_case_name": "Error Code -1 - Missing Required Request Body Field Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。", "duration_seconds": 0.03236400004243478, "timestamp": "2025-06-20T10:38:21.352075", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。" } ] }, { "test_case_id": "TC-ERROR-4003-QUERY", "test_case_name": "Error Code -1 - Missing Required Query Parameter Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。", "duration_seconds": 0.029946250026114285, "timestamp": "2025-06-20T10:38:21.382159", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。" } ] } ] }, { "endpoint_id": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}", "endpoint_name": "地质单元列表查询", "overall_status": "失败", "duration_seconds": 7.438804, "start_time": "2025-06-20T10:38:21.382422", "end_time": "2025-06-20T10:38:28.821226", "executed_test_cases": [ { "test_case_id": "TC-HEADER-001", "test_case_name": "必需请求头Schema验证", "test_case_severity": "严重", "status": "失败", "message": "缺少必需的请求头 X-Tenant-ID;缺少必需的请求头 X-Data-Domain", "duration_seconds": 0.056114999984856695, "timestamp": "2025-06-20T10:38:21.439172", "validation_points": [ { "header": "X-Tenant-ID", "possible_names": [ "X-Tenant-ID" ], "endpoint": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}" }, { "header": "X-Data-Domain", "possible_names": [ "X-Data-Domain" ], "endpoint": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}" } ] }, { "test_case_id": "TC-STATUS-001", "test_case_name": "基本状态码 200 检查", "test_case_severity": "严重", "status": "通过", "message": "响应状态码为 200,符合预期 200。", "duration_seconds": 0.027234709006734192, "timestamp": "2025-06-20T10:38:21.466525", "validation_points": [ { "passed": true, "message": "响应状态码为 200,符合预期 200。" } ] }, { "test_case_id": "TC-SECURITY-002", "test_case_name": "敏感字段加密检查", "test_case_severity": "高", "status": "通过", "message": "未在响应中找到需要检查的敏感字段。", "duration_seconds": 0.043664125027135015, "timestamp": "2025-06-20T10:38:21.510335", "validation_points": [ { "passed": true, "message": "未在响应中找到需要检查的敏感字段。" } ] }, { "test_case_id": "TC-LLM-COMPLIANCE-001", "test_case_name": "LLM合规性综合检查", "test_case_severity": "中", "status": "通过", "message": "[API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除] 通过: API调用使用了POST方法,并且根据其路径和请求体内容判断,该操作符合创建资源的语义,因此符合标准。", "duration_seconds": 6.848316542047542, "timestamp": "2025-06-20T10:38:28.358970", "validation_points": [ { "criterion": "API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除", "llm_reason": "API调用使用了POST方法,并且根据其路径和请求体内容判断,该操作符合创建资源的语义,因此符合标准。" } ] }, { "test_case_id": "TC-RESTful-001", "test_case_name": "核心命名与结构规范检查", "test_case_severity": "高", "status": "通过", "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。;规范中未找到响应码 200 或其类别(2XX, default)的匹配定义,跳过空数组与null的检查。", "duration_seconds": 0.049271332973148674, "timestamp": "2025-06-20T10:38:28.408760", "validation_points": [ { "passed": true, "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。" }, { "passed": true, "message": "规范中未找到响应码 200 或其类别(2XX, default)的匹配定义,跳过空数组与null的检查。" } ] }, { "test_case_id": "TC-DMS-PAGINATION-001", "test_case_name": "分页参数检查", "test_case_severity": "中", "status": "通过", "message": "API请求包含所有标准分页参数:pageNo、pageSize和isSearchCount", "duration_seconds": 0.028598375036381185, "timestamp": "2025-06-20T10:38:28.437526", "validation_points": [ { "path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}", "method": "POST" } ] }, { "test_case_id": "TC-RESTful-002", "test_case_name": "资源路径名词检查", "test_case_severity": "中", "status": "通过", "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 符合资源名词命名规范。", "duration_seconds": 0.02779416600242257, "timestamp": "2025-06-20T10:38:28.465610", "validation_points": [ { "passed": true, "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 符合资源名词命名规范。" } ] }, { "test_case_id": "TC-DMS-CORE-SCHEMA-001", "test_case_name": "DMS核心存储服务API响应格式检查", "test_case_severity": "高", "status": "通过", "message": "字段'code'在schema中未标记为必填(required);字段'message'在schema中未标记为必填(required);字段'data'在schema中未标记为必填(required);响应schema符合标准格式: {'code':int or number or string, 'message':string, 'data': any}", "duration_seconds": 0.03907008399255574, "timestamp": "2025-06-20T10:38:28.504956", "validation_points": [ { "status_code": "201", "required_fields": [] }, { "status_code": "201", "required_fields": [] }, { "status_code": "201", "required_fields": [] }, { "status_code": "201" } ] }, { "test_case_id": "TC-CORE-FUNC-001", "test_case_name": "Response Body JSON Schema Validation", "test_case_severity": "严重", "status": "通过", "message": "Schema验证步骤完成(未发现问题,或schema不适用/未为此响应定义)。", "duration_seconds": 0.036994958005379885, "timestamp": "2025-06-20T10:38:28.542268", "validation_points": [ { "passed": true, "message": "Schema验证步骤完成(未发现问题,或schema不适用/未为此响应定义)。" } ] }, { "test_case_id": "TC-RESTful-003", "test_case_name": "时间字段ISO 8601格式检查", "test_case_severity": "中", "status": "通过", "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。", "duration_seconds": 0.03333795798243955, "timestamp": "2025-06-20T10:38:28.575740", "validation_points": [ { "passed": true, "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。" } ] }, { "test_case_id": "TC-DMS-URL-VERSION-001", "test_case_name": "DMS API URL版本号检查", "test_case_severity": "中", "status": "通过", "message": "API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 正确以'/api/'开头;API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 包含版本标识: 'v1'", "duration_seconds": 0.02890299999853596, "timestamp": "2025-06-20T10:38:28.604925", "validation_points": [ { "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}" }, { "pattern_matched": "/v\\d+/", "version_string": "v1", "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}" } ] }, { "test_case_id": "TC-SECURITY-001", "test_case_name": "HTTPS Protocol Mandatory Verification", "test_case_severity": "严重", "status": "失败", "message": "API通过HTTP (http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0) 响应了成功的状态码 200,这违反了HTTPS强制策略。", "duration_seconds": 0.02864774997578934, "timestamp": "2025-06-20T10:38:28.634051", "validation_points": [ { "status_code": 200 } ] }, { "test_case_id": "TC-ERROR-4001-QUERY", "test_case_name": "Error Code -1 - Query Parameter Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当查询参数 'pageNo' (路径: 'pageNo') 类型不匹配时, 业务错误码应为 -1,但实际为 40。", "duration_seconds": 0.036543624999467283, "timestamp": "2025-06-20T10:38:28.670733", "validation_points": [ { "expected_code": -1, "actual_code": 40, "response_body": { "code": 40, "message": "id non", "data": { "total": 3, "list": [ { "dsid": "15", "dataRegion": "velit qui id nulla", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null }, { "dsid": "39", "dataRegion": "ad reprehenderit", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null } ] } } } ] }, { "test_case_id": "TC-ERROR-4001-BODY", "test_case_name": "Error Code -1 - Request Body Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当请求体字段 'isSearchCount' 类型不匹配时, 业务错误码应为 -1,但实际为 72。", "duration_seconds": 0.03071037499466911, "timestamp": "2025-06-20T10:38:28.701723", "validation_points": [ { "expected_code": -1, "actual_code": 72, "response_body": { "code": 72, "message": "ut dolor", "data": { "total": 100, "list": [ { "dsid": "23", "dataRegion": "tempor Duis", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null }, { "dsid": "49", "dataRegion": "dolore sed cupidatat", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null } ] } } } ] }, { "test_case_id": "TC-ERROR-4002", "test_case_name": "Error Code -1 - Number Value Out of Range Validation", "test_case_severity": "中", "status": "失败", "message": "当 query 字段 'pageNo' 值为 0.0 (超出范围: min=1.0, max=None) 时, 业务错误码应为 -1,但实际为 94。", "duration_seconds": 0.028056916024070233, "timestamp": "2025-06-20T10:38:28.730060", "validation_points": [ { "expected_code": -1, "actual_code": 94, "response_body": { "code": 94, "message": "culpa est tempor eu ipsum", "data": { "total": 73, "list": [ { "dsid": "31", "dataRegion": "non anim", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null } ] } } } ] }, { "test_case_id": "TC-ERROR-4006", "test_case_name": "Error Code 4006 - Invalid Enum Value Validation", "test_case_severity": "中", "status": "失败", "message": "当 body 字段 'logic' 值为 'invalid_enum_wf2e1t' (合法值为: ['AND', 'OR']) 时, 业务错误码应为 -1,但实际为 59。", "duration_seconds": 0.026858832978177816, "timestamp": "2025-06-20T10:38:28.757132", "validation_points": [ { "expected_code": -1, "actual_code": 59, "response_body": { "code": 59, "message": "anim occaecat", "data": { "total": 52, "list": [ { "dsid": "82", "dataRegion": "voluptate aliquip elit minim pariatur", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null }, { "dsid": "12", "dataRegion": "esse nostrud velit in", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null } ] } } } ] }, { "test_case_id": "TC-ERROR-4003-BODY", "test_case_name": "Error Code -1 - Missing Required Request Body Field Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。", "duration_seconds": 0.027073665987700224, "timestamp": "2025-06-20T10:38:28.784505", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。" } ] }, { "test_case_id": "TC-ERROR-4003-QUERY", "test_case_name": "Error Code -1 - Missing Required Query Parameter Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。", "duration_seconds": 0.03639554203255102, "timestamp": "2025-06-20T10:38:28.821099", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。" } ] } ] }, { "endpoint_id": "PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit", "endpoint_name": "地质单元数据修改", "overall_status": "失败", "duration_seconds": 5.377887, "start_time": "2025-06-20T10:38:28.821352", "end_time": "2025-06-20T10:38:34.199239", "executed_test_cases": [ { "test_case_id": "TC-HEADER-001", "test_case_name": "必需请求头Schema验证", "test_case_severity": "严重", "status": "失败", "message": "缺少必需的请求头 X-Tenant-ID;缺少必需的请求头 X-Data-Domain", "duration_seconds": 0.041237249970436096, "timestamp": "2025-06-20T10:38:28.863143", "validation_points": [ { "header": "X-Tenant-ID", "possible_names": [ "X-Tenant-ID" ], "endpoint": "PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit" }, { "header": "X-Data-Domain", "possible_names": [ "X-Data-Domain" ], "endpoint": "PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit" } ] }, { "test_case_id": "TC-STATUS-001", "test_case_name": "基本状态码 200 检查", "test_case_severity": "严重", "status": "通过", "message": "响应状态码为 200,符合预期 200。", "duration_seconds": 0.027748083986807615, "timestamp": "2025-06-20T10:38:28.891000", "validation_points": [ { "passed": true, "message": "响应状态码为 200,符合预期 200。" } ] }, { "test_case_id": "TC-SECURITY-002", "test_case_name": "敏感字段加密检查", "test_case_severity": "高", "status": "通过", "message": "未在响应中找到需要检查的敏感字段。", "duration_seconds": 0.03254245803691447, "timestamp": "2025-06-20T10:38:28.923672", "validation_points": [ { "passed": true, "message": "未在响应中找到需要检查的敏感字段。" } ] }, { "test_case_id": "TC-LLM-COMPLIANCE-001", "test_case_name": "LLM合规性综合检查", "test_case_severity": "中", "status": "通过", "message": "[API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除] 通过: 当前API调用使用了PUT方法,并且根据其路径和操作内容(更新cd_geo_unit资源),符合PUT方法用于更新的语义。", "duration_seconds": 4.864971250004601, "timestamp": "2025-06-20T10:38:33.788910", "validation_points": [ { "criterion": "API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除", "llm_reason": "当前API调用使用了PUT方法,并且根据其路径和操作内容(更新cd_geo_unit资源),符合PUT方法用于更新的语义。" } ] }, { "test_case_id": "TC-RESTful-001", "test_case_name": "核心命名与结构规范检查", "test_case_severity": "高", "status": "通过", "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。", "duration_seconds": 0.0591976250289008, "timestamp": "2025-06-20T10:38:33.848265", "validation_points": [ { "passed": true, "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。" } ] }, { "test_case_id": "TC-DMS-PAGINATION-001", "test_case_name": "分页参数检查", "test_case_severity": "中", "status": "通过", "message": "跳过检查:API不符合分页参数检查的准入规则(需包含'查询'/'列表'等关键词,且不包含'详情'等关键词)", "duration_seconds": 0.03255012503359467, "timestamp": "2025-06-20T10:38:33.880897", "validation_points": [ { "path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit", "method": "PUT", "summary": "地质单元数据修改", "contains_include_keyword": false, "contains_exclude_keyword": false } ] }, { "test_case_id": "TC-RESTful-002", "test_case_name": "资源路径名词检查", "test_case_severity": "中", "status": "通过", "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 符合资源名词命名规范。", "duration_seconds": 0.027814333036076277, "timestamp": "2025-06-20T10:38:33.908940", "validation_points": [ { "passed": true, "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 符合资源名词命名规范。" } ] }, { "test_case_id": "TC-DMS-CORE-SCHEMA-001", "test_case_name": "DMS核心存储服务API响应格式检查", "test_case_severity": "高", "status": "通过", "message": "字段'code'在schema中未标记为必填(required);字段'message'在schema中未标记为必填(required);字段'data'在schema中未标记为必填(required);响应schema符合标准格式: {'code':int or number or string, 'message':string, 'data': any}", "duration_seconds": 0.025110665999818593, "timestamp": "2025-06-20T10:38:33.934226", "validation_points": [ { "status_code": "200", "required_fields": [] }, { "status_code": "200", "required_fields": [] }, { "status_code": "200", "required_fields": [] }, { "status_code": "200" } ] }, { "test_case_id": "TC-CORE-FUNC-001", "test_case_name": "Response Body JSON Schema Validation", "test_case_severity": "严重", "status": "通过", "message": "针对 PUT http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit (状态码 200) 的响应体 conforms to the JSON schema.", "duration_seconds": 0.026640458032488823, "timestamp": "2025-06-20T10:38:33.961002", "validation_points": [ { "passed": true, "message": "针对 PUT http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit (状态码 200) 的响应体 conforms to the JSON schema." } ] }, { "test_case_id": "TC-RESTful-003", "test_case_name": "时间字段ISO 8601格式检查", "test_case_severity": "中", "status": "通过", "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。", "duration_seconds": 0.03917824995005503, "timestamp": "2025-06-20T10:38:34.000308", "validation_points": [ { "passed": true, "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。" } ] }, { "test_case_id": "TC-DMS-URL-VERSION-001", "test_case_name": "DMS API URL版本号检查", "test_case_severity": "中", "status": "通过", "message": "API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 正确以'/api/'开头;API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 包含版本标识: 'v1'", "duration_seconds": 0.03242937498725951, "timestamp": "2025-06-20T10:38:34.032932", "validation_points": [ { "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit" }, { "pattern_matched": "/v\\d+/", "version_string": "v1", "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit" } ] }, { "test_case_id": "TC-SECURITY-001", "test_case_name": "HTTPS Protocol Mandatory Verification", "test_case_severity": "严重", "status": "失败", "message": "API通过HTTP (http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit) 响应了成功的状态码 200,这违反了HTTPS强制策略。", "duration_seconds": 0.022750500007532537, "timestamp": "2025-06-20T10:38:34.055860", "validation_points": [ { "status_code": 200 } ] }, { "test_case_id": "TC-ERROR-4001-QUERY", "test_case_name": "Error Code -1 - Query Parameter Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当查询参数 'id' (路径: 'id') 类型不匹配时, 业务错误码应为 -1,但实际为 49。", "duration_seconds": 0.024243334017228335, "timestamp": "2025-06-20T10:38:34.080199", "validation_points": [ { "expected_code": -1, "actual_code": 49, "response_body": { "code": 49, "message": "esse eiusmod", "data": false } } ] }, { "test_case_id": "TC-ERROR-4001-BODY", "test_case_name": "Error Code -1 - Request Body Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当请求体字段 'id' 类型不匹配时, 业务错误码应为 -1,但实际为 14。", "duration_seconds": 0.02337008301401511, "timestamp": "2025-06-20T10:38:34.103651", "validation_points": [ { "expected_code": -1, "actual_code": 14, "response_body": { "code": 14, "message": "quis", "data": true } } ] }, { "test_case_id": "TC-ERROR-4002", "test_case_name": "Error Code -1 - Number Value Out of Range Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确范围限制的数值字段。", "duration_seconds": 0.026526166999246925, "timestamp": "2025-06-20T10:38:34.130256", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确范围限制的数值字段。" } ] }, { "test_case_id": "TC-ERROR-4006", "test_case_name": "Error Code 4006 - Invalid Enum Value Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确枚举值限制的字段。", "duration_seconds": 0.021649874979630113, "timestamp": "2025-06-20T10:38:34.151998", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确枚举值限制的字段。" } ] }, { "test_case_id": "TC-ERROR-4003-BODY", "test_case_name": "Error Code -1 - Missing Required Request Body Field Validation", "test_case_severity": "高", "status": "失败", "message": "当移除必填请求体字段 'id' 时, 业务错误码应为 -1,但实际为 4003。", "duration_seconds": 0.024231999996118248, "timestamp": "2025-06-20T10:38:34.176389", "validation_points": [ { "expected_code": -1, "actual_code": 4003, "response_body": { "code": 4003 } } ] }, { "test_case_id": "TC-ERROR-4003-QUERY", "test_case_name": "Error Code -1 - Missing Required Query Parameter Validation", "test_case_severity": "高", "status": "失败", "message": "当移除必填查询参数 'id' 时, 业务错误码应为 -1,但实际为 48。", "duration_seconds": 0.02258983300998807, "timestamp": "2025-06-20T10:38:34.199111", "validation_points": [ { "expected_code": -1, "actual_code": 48, "response_body": { "code": 48, "message": "voluptate", "data": true } } ] } ] }, { "endpoint_id": "DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit", "endpoint_name": "地质单元数据删除", "overall_status": "失败", "duration_seconds": 6.727812, "start_time": "2025-06-20T10:38:34.199297", "end_time": "2025-06-20T10:38:40.927109", "executed_test_cases": [ { "test_case_id": "TC-HEADER-001", "test_case_name": "必需请求头Schema验证", "test_case_severity": "严重", "status": "失败", "message": "缺少必需的请求头 X-Tenant-ID;缺少必需的请求头 X-Data-Domain", "duration_seconds": 0.0212352920207195, "timestamp": "2025-06-20T10:38:34.220840", "validation_points": [ { "header": "X-Tenant-ID", "possible_names": [ "X-Tenant-ID" ], "endpoint": "DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit" }, { "header": "X-Data-Domain", "possible_names": [ "X-Data-Domain" ], "endpoint": "DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit" } ] }, { "test_case_id": "TC-STATUS-001", "test_case_name": "基本状态码 200 检查", "test_case_severity": "严重", "status": "通过", "message": "响应状态码为 200,符合预期 200。", "duration_seconds": 0.030489667027723044, "timestamp": "2025-06-20T10:38:34.251402", "validation_points": [ { "passed": true, "message": "响应状态码为 200,符合预期 200。" } ] }, { "test_case_id": "TC-SECURITY-002", "test_case_name": "敏感字段加密检查", "test_case_severity": "高", "status": "通过", "message": "未在响应中找到需要检查的敏感字段。", "duration_seconds": 0.027502166980411857, "timestamp": "2025-06-20T10:38:34.279049", "validation_points": [ { "passed": true, "message": "未在响应中找到需要检查的敏感字段。" } ] }, { "test_case_id": "TC-LLM-COMPLIANCE-001", "test_case_name": "LLM合规性综合检查", "test_case_severity": "中", "status": "通过", "message": "[API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除] 通过: API使用了DELETE方法,并且其操作符合DELETE语义,即删除资源(/cd_geo_unit)。因此该标准通过。", "duration_seconds": 6.2821086249896325, "timestamp": "2025-06-20T10:38:40.561424", "validation_points": [ { "criterion": "API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除", "llm_reason": "API使用了DELETE方法,并且其操作符合DELETE语义,即删除资源(/cd_geo_unit)。因此该标准通过。" } ] }, { "test_case_id": "TC-RESTful-001", "test_case_name": "核心命名与结构规范检查", "test_case_severity": "高", "status": "通过", "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。", "duration_seconds": 0.04058187495684251, "timestamp": "2025-06-20T10:38:40.602098", "validation_points": [ { "passed": true, "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。" } ] }, { "test_case_id": "TC-DMS-PAGINATION-001", "test_case_name": "分页参数检查", "test_case_severity": "中", "status": "通过", "message": "跳过检查:API不符合分页参数检查的准入规则(需包含'查询'/'列表'等关键词,且不包含'详情'等关键词)", "duration_seconds": 0.023962375009432435, "timestamp": "2025-06-20T10:38:40.626140", "validation_points": [ { "path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit", "method": "DELETE", "summary": "地质单元数据删除", "contains_include_keyword": false, "contains_exclude_keyword": false } ] }, { "test_case_id": "TC-RESTful-002", "test_case_name": "资源路径名词检查", "test_case_severity": "中", "status": "通过", "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 符合资源名词命名规范。", "duration_seconds": 0.03262416698271409, "timestamp": "2025-06-20T10:38:40.658944", "validation_points": [ { "passed": true, "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 符合资源名词命名规范。" } ] }, { "test_case_id": "TC-DMS-CORE-SCHEMA-001", "test_case_name": "DMS核心存储服务API响应格式检查", "test_case_severity": "高", "status": "通过", "message": "字段'code'在schema中未标记为必填(required);字段'message'在schema中未标记为必填(required);字段'data'在schema中未标记为必填(required);响应schema符合标准格式: {'code':int or number or string, 'message':string, 'data': any}", "duration_seconds": 0.03017762501258403, "timestamp": "2025-06-20T10:38:40.689297", "validation_points": [ { "status_code": "200", "required_fields": [] }, { "status_code": "200", "required_fields": [] }, { "status_code": "200", "required_fields": [] }, { "status_code": "200" } ] }, { "test_case_id": "TC-CORE-FUNC-001", "test_case_name": "Response Body JSON Schema Validation", "test_case_severity": "严重", "status": "通过", "message": "针对 DELETE http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit (状态码 200) 的响应体 conforms to the JSON schema.", "duration_seconds": 0.022072583029512316, "timestamp": "2025-06-20T10:38:40.711512", "validation_points": [ { "passed": true, "message": "针对 DELETE http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit (状态码 200) 的响应体 conforms to the JSON schema." } ] }, { "test_case_id": "TC-RESTful-003", "test_case_name": "时间字段ISO 8601格式检查", "test_case_severity": "中", "status": "通过", "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。", "duration_seconds": 0.02416662499308586, "timestamp": "2025-06-20T10:38:40.735773", "validation_points": [ { "passed": true, "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。" } ] }, { "test_case_id": "TC-DMS-URL-VERSION-001", "test_case_name": "DMS API URL版本号检查", "test_case_severity": "中", "status": "通过", "message": "API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 正确以'/api/'开头;API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 包含版本标识: 'v1'", "duration_seconds": 0.021162709046620876, "timestamp": "2025-06-20T10:38:40.757073", "validation_points": [ { "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit" }, { "pattern_matched": "/v\\d+/", "version_string": "v1", "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit" } ] }, { "test_case_id": "TC-SECURITY-001", "test_case_name": "HTTPS Protocol Mandatory Verification", "test_case_severity": "严重", "status": "失败", "message": "API通过HTTP (http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit) 响应了成功的状态码 200,这违反了HTTPS强制策略。", "duration_seconds": 0.02383991703391075, "timestamp": "2025-06-20T10:38:40.781061", "validation_points": [ { "status_code": 200 } ] }, { "test_case_id": "TC-ERROR-4001-QUERY", "test_case_name": "Error Code -1 - Query Parameter Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当查询参数 'id' (路径: 'id') 类型不匹配时, 业务错误码应为 -1,但实际为 26。", "duration_seconds": 0.02577187499264255, "timestamp": "2025-06-20T10:38:40.806913", "validation_points": [ { "expected_code": -1, "actual_code": 26, "response_body": { "code": 26, "message": "laboris deserunt in commodo", "data": true } } ] }, { "test_case_id": "TC-ERROR-4001-BODY", "test_case_name": "Error Code -1 - Request Body Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当请求体字段 'version' 类型不匹配时, 业务错误码应为 -1,但实际为 40。", "duration_seconds": 0.028503832989372313, "timestamp": "2025-06-20T10:38:40.835519", "validation_points": [ { "expected_code": -1, "actual_code": 40, "response_body": { "code": 40, "message": "in incididunt dolore reprehenderit", "data": false } } ] }, { "test_case_id": "TC-ERROR-4002", "test_case_name": "Error Code -1 - Number Value Out of Range Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确范围限制的数值字段。", "duration_seconds": 0.022478625003714114, "timestamp": "2025-06-20T10:38:40.858090", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确范围限制的数值字段。" } ] }, { "test_case_id": "TC-ERROR-4006", "test_case_name": "Error Code 4006 - Invalid Enum Value Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确枚举值限制的字段。", "duration_seconds": 0.022049166029319167, "timestamp": "2025-06-20T10:38:40.880233", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确枚举值限制的字段。" } ] }, { "test_case_id": "TC-ERROR-4003-BODY", "test_case_name": "Error Code -1 - Missing Required Request Body Field Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。", "duration_seconds": 0.023871957964729518, "timestamp": "2025-06-20T10:38:40.904268", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。" } ] }, { "test_case_id": "TC-ERROR-4003-QUERY", "test_case_name": "Error Code -1 - Missing Required Query Parameter Validation", "test_case_severity": "高", "status": "失败", "message": "当移除必填查询参数 'id' 时, 业务错误码应为 -1,但实际为 86。", "duration_seconds": 0.022433207952417433, "timestamp": "2025-06-20T10:38:40.926894", "validation_points": [ { "expected_code": -1, "actual_code": 86, "response_body": { "code": 86, "message": "voluptate ut esse dolore", "data": false } } ] } ] }, { "endpoint_id": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit", "endpoint_name": "地质单元数据添加", "overall_status": "失败", "duration_seconds": 6.774374, "start_time": "2025-06-20T10:38:40.927219", "end_time": "2025-06-20T10:38:47.701593", "executed_test_cases": [ { "test_case_id": "TC-HEADER-001", "test_case_name": "必需请求头Schema验证", "test_case_severity": "严重", "status": "失败", "message": "缺少必需的请求头 X-Tenant-ID;缺少必需的请求头 X-Data-Domain", "duration_seconds": 0.026954166998621076, "timestamp": "2025-06-20T10:38:40.954763", "validation_points": [ { "header": "X-Tenant-ID", "possible_names": [ "X-Tenant-ID" ], "endpoint": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit" }, { "header": "X-Data-Domain", "possible_names": [ "X-Data-Domain" ], "endpoint": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit" } ] }, { "test_case_id": "TC-STATUS-001", "test_case_name": "基本状态码 200 检查", "test_case_severity": "严重", "status": "通过", "message": "响应状态码为 200,符合预期 200。", "duration_seconds": 0.026489791984204203, "timestamp": "2025-06-20T10:38:40.981434", "validation_points": [ { "passed": true, "message": "响应状态码为 200,符合预期 200。" } ] }, { "test_case_id": "TC-SECURITY-002", "test_case_name": "敏感字段加密检查", "test_case_severity": "高", "status": "通过", "message": "未在响应中找到需要检查的敏感字段。", "duration_seconds": 0.024440083012450486, "timestamp": "2025-06-20T10:38:41.006184", "validation_points": [ { "passed": true, "message": "未在响应中找到需要检查的敏感字段。" } ] }, { "test_case_id": "TC-LLM-COMPLIANCE-001", "test_case_name": "LLM合规性综合检查", "test_case_severity": "中", "status": "通过", "message": "[API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除] 通过: 当前API调用使用了POST方法,且根据其路径和操作内容(/cd_geo_unit),可以合理推测该请求的目的是创建或新增资源,符合POST方法的语义。", "duration_seconds": 6.051443292002659, "timestamp": "2025-06-20T10:38:47.057981", "validation_points": [ { "criterion": "API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除", "llm_reason": "当前API调用使用了POST方法,且根据其路径和操作内容(/cd_geo_unit),可以合理推测该请求的目的是创建或新增资源,符合POST方法的语义。" } ] }, { "test_case_id": "TC-RESTful-001", "test_case_name": "核心命名与结构规范检查", "test_case_severity": "高", "status": "通过", "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。;规范中未找到响应码 200 或其类别(2XX, default)的匹配定义,跳过空数组与null的检查。", "duration_seconds": 0.041716374980751425, "timestamp": "2025-06-20T10:38:47.099974", "validation_points": [ { "passed": true, "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。" }, { "passed": true, "message": "规范中未找到响应码 200 或其类别(2XX, default)的匹配定义,跳过空数组与null的检查。" } ] }, { "test_case_id": "TC-DMS-PAGINATION-001", "test_case_name": "分页参数检查", "test_case_severity": "中", "status": "通过", "message": "跳过检查:API不符合分页参数检查的准入规则(需包含'查询'/'列表'等关键词,且不包含'详情'等关键词)", "duration_seconds": 0.05762145802145824, "timestamp": "2025-06-20T10:38:47.157748", "validation_points": [ { "path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit", "method": "POST", "summary": "地质单元数据添加", "contains_include_keyword": false, "contains_exclude_keyword": false } ] }, { "test_case_id": "TC-RESTful-002", "test_case_name": "资源路径名词检查", "test_case_severity": "中", "status": "通过", "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 符合资源名词命名规范。", "duration_seconds": 0.04528516699792817, "timestamp": "2025-06-20T10:38:47.203335", "validation_points": [ { "passed": true, "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 符合资源名词命名规范。" } ] }, { "test_case_id": "TC-DMS-CORE-SCHEMA-001", "test_case_name": "DMS核心存储服务API响应格式检查", "test_case_severity": "高", "status": "通过", "message": "字段'code'在schema中未标记为必填(required);字段'message'在schema中未标记为必填(required);字段'data'在schema中未标记为必填(required);响应schema符合标准格式: {'code':int or number or string, 'message':string, 'data': any}", "duration_seconds": 0.04071241698693484, "timestamp": "2025-06-20T10:38:47.244308", "validation_points": [ { "status_code": "201", "required_fields": [] }, { "status_code": "201", "required_fields": [] }, { "status_code": "201", "required_fields": [] }, { "status_code": "201" } ] }, { "test_case_id": "TC-CORE-FUNC-001", "test_case_name": "Response Body JSON Schema Validation", "test_case_severity": "严重", "status": "通过", "message": "Schema验证步骤完成(未发现问题,或schema不适用/未为此响应定义)。", "duration_seconds": 0.03822166699683294, "timestamp": "2025-06-20T10:38:47.282788", "validation_points": [ { "passed": true, "message": "Schema验证步骤完成(未发现问题,或schema不适用/未为此响应定义)。" } ] }, { "test_case_id": "TC-RESTful-003", "test_case_name": "时间字段ISO 8601格式检查", "test_case_severity": "中", "status": "通过", "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。", "duration_seconds": 0.07827374996850267, "timestamp": "2025-06-20T10:38:47.361388", "validation_points": [ { "passed": true, "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。" } ] }, { "test_case_id": "TC-DMS-URL-VERSION-001", "test_case_name": "DMS API URL版本号检查", "test_case_severity": "中", "status": "通过", "message": "API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 正确以'/api/'开头;API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit' 包含版本标识: 'v1'", "duration_seconds": 0.06431558396434411, "timestamp": "2025-06-20T10:38:47.426017", "validation_points": [ { "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit" }, { "pattern_matched": "/v\\d+/", "version_string": "v1", "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit" } ] }, { "test_case_id": "TC-SECURITY-001", "test_case_name": "HTTPS Protocol Mandatory Verification", "test_case_severity": "严重", "status": "失败", "message": "API通过HTTP (http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit) 响应了成功的状态码 200,这违反了HTTPS强制策略。", "duration_seconds": 0.06295849999878556, "timestamp": "2025-06-20T10:38:47.489347", "validation_points": [ { "status_code": 200 } ] }, { "test_case_id": "TC-ERROR-4001-QUERY", "test_case_name": "Error Code -1 - Query Parameter Type Mismatch Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:在查询参数中未找到合适的字段来测试类型不匹配。", "duration_seconds": 0.04038804100127891, "timestamp": "2025-06-20T10:38:47.529931", "validation_points": [ { "passed": true, "message": "跳过测试:在查询参数中未找到合适的字段来测试类型不匹配。" } ] }, { "test_case_id": "TC-ERROR-4001-BODY", "test_case_name": "Error Code -1 - Request Body Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当请求体字段 'version' 类型不匹配时, 业务错误码应为 -1,但实际为 13。", "duration_seconds": 0.04391466605011374, "timestamp": "2025-06-20T10:38:47.573976", "validation_points": [ { "expected_code": -1, "actual_code": 13, "response_body": { "code": 13, "message": "ad est laboris ut", "data": true } } ] }, { "test_case_id": "TC-ERROR-4002", "test_case_name": "Error Code -1 - Number Value Out of Range Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确范围限制的数值字段。", "duration_seconds": 0.05720537499291822, "timestamp": "2025-06-20T10:38:47.631307", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确范围限制的数值字段。" } ] }, { "test_case_id": "TC-ERROR-4006", "test_case_name": "Error Code 4006 - Invalid Enum Value Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确枚举值限制的字段。", "duration_seconds": 0.025229415972717106, "timestamp": "2025-06-20T10:38:47.656655", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确枚举值限制的字段。" } ] }, { "test_case_id": "TC-ERROR-4003-BODY", "test_case_name": "Error Code -1 - Missing Required Request Body Field Validation", "test_case_severity": "高", "status": "失败", "message": "当移除必填请求体字段 'data.0.bsflag' 时, 业务错误码应为 -1,但实际为 26。", "duration_seconds": 0.02299600001424551, "timestamp": "2025-06-20T10:38:47.679789", "validation_points": [ { "expected_code": -1, "actual_code": 26, "response_body": { "code": 26, "message": "occaecat do", "data": true } } ] }, { "test_case_id": "TC-ERROR-4003-QUERY", "test_case_name": "Error Code -1 - Missing Required Query Parameter Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。", "duration_seconds": 0.021551040990743786, "timestamp": "2025-06-20T10:38:47.701513", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。" } ] } ] }, { "endpoint_id": "GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}", "endpoint_name": "地质单元查询详情", "overall_status": "失败", "duration_seconds": 5.594781, "start_time": "2025-06-20T10:38:47.701657", "end_time": "2025-06-20T10:38:53.296438", "executed_test_cases": [ { "test_case_id": "TC-HEADER-001", "test_case_name": "必需请求头Schema验证", "test_case_severity": "严重", "status": "失败", "message": "缺少必需的请求头 X-Tenant-ID;缺少必需的请求头 X-Data-Domain", "duration_seconds": 0.022210875002201647, "timestamp": "2025-06-20T10:38:47.724177", "validation_points": [ { "header": "X-Tenant-ID", "possible_names": [ "X-Tenant-ID" ], "endpoint": "GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}" }, { "header": "X-Data-Domain", "possible_names": [ "X-Data-Domain" ], "endpoint": "GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}" } ] }, { "test_case_id": "TC-STATUS-001", "test_case_name": "基本状态码 200 检查", "test_case_severity": "严重", "status": "通过", "message": "响应状态码为 200,符合预期 200。", "duration_seconds": 0.026287290966138244, "timestamp": "2025-06-20T10:38:47.750536", "validation_points": [ { "passed": true, "message": "响应状态码为 200,符合预期 200。" } ] }, { "test_case_id": "TC-SECURITY-002", "test_case_name": "敏感字段加密检查", "test_case_severity": "高", "status": "通过", "message": "未在响应中找到需要检查的敏感字段。", "duration_seconds": 0.030695665976963937, "timestamp": "2025-06-20T10:38:47.781324", "validation_points": [ { "passed": true, "message": "未在响应中找到需要检查的敏感字段。" } ] }, { "test_case_id": "TC-LLM-COMPLIANCE-001", "test_case_name": "LLM合规性综合检查", "test_case_severity": "中", "status": "通过", "message": "[API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除] 通过: 当前API调用使用了GET方法,并且其路径和参数表明它正在检索特定id(example_id)的数据,符合GET方法的用途。", "duration_seconds": 5.105087374977302, "timestamp": "2025-06-20T10:38:52.886647", "validation_points": [ { "criterion": "API应该使用正确的HTTP方法:GET用于检索,POST用于创建,PUT用于更新,DELETE用于删除", "llm_reason": "当前API调用使用了GET方法,并且其路径和参数表明它正在检索特定id(example_id)的数据,符合GET方法的用途。" } ] }, { "test_case_id": "TC-RESTful-001", "test_case_name": "核心命名与结构规范检查", "test_case_severity": "高", "status": "通过", "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。", "duration_seconds": 0.04652762500336394, "timestamp": "2025-06-20T10:38:52.933604", "validation_points": [ { "passed": true, "message": "模块名 'dms' 格式正确 (全小写/数字/中划线)。" } ] }, { "test_case_id": "TC-DMS-PAGINATION-001", "test_case_name": "分页参数检查", "test_case_severity": "中", "status": "通过", "message": "跳过检查:API不符合分页参数检查的准入规则(需包含'查询'/'列表'等关键词,且不包含'详情'等关键词)", "duration_seconds": 0.026140625006519258, "timestamp": "2025-06-20T10:38:52.959982", "validation_points": [ { "path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}", "method": "GET", "summary": "地质单元查询详情", "contains_include_keyword": true, "contains_exclude_keyword": true } ] }, { "test_case_id": "TC-RESTful-002", "test_case_name": "资源路径名词检查", "test_case_severity": "中", "status": "通过", "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 符合资源名词命名规范。", "duration_seconds": 0.02623962500365451, "timestamp": "2025-06-20T10:38:52.986735", "validation_points": [ { "passed": true, "message": "路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 符合资源名词命名规范。" } ] }, { "test_case_id": "TC-DMS-CORE-SCHEMA-001", "test_case_name": "DMS核心存储服务API响应格式检查", "test_case_severity": "高", "status": "通过", "message": "字段'code'在schema中未标记为必填(required);字段'message'在schema中未标记为必填(required);字段'data'在schema中未标记为必填(required);响应schema符合标准格式: {'code':int or number or string, 'message':string, 'data': any}", "duration_seconds": 0.029397084028460085, "timestamp": "2025-06-20T10:38:53.016450", "validation_points": [ { "status_code": "200", "required_fields": [] }, { "status_code": "200", "required_fields": [] }, { "status_code": "200", "required_fields": [] }, { "status_code": "200" } ] }, { "test_case_id": "TC-CORE-FUNC-001", "test_case_name": "Response Body JSON Schema Validation", "test_case_severity": "严重", "status": "通过", "message": "针对 GET http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0/example_id (状态码 200) 的响应体 conforms to the JSON schema.", "duration_seconds": 0.039132957987021655, "timestamp": "2025-06-20T10:38:53.055964", "validation_points": [ { "passed": true, "message": "针对 GET http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0/example_id (状态码 200) 的响应体 conforms to the JSON schema." } ] }, { "test_case_id": "TC-RESTful-003", "test_case_name": "时间字段ISO 8601格式检查", "test_case_severity": "中", "status": "通过", "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。", "duration_seconds": 0.026158416992984712, "timestamp": "2025-06-20T10:38:53.082286", "validation_points": [ { "passed": true, "message": "在API规范中未找到可供静态检查的时间相关字段(如 format: date-time 或 常见时间字段名)。" } ] }, { "test_case_id": "TC-DMS-URL-VERSION-001", "test_case_name": "DMS API URL版本号检查", "test_case_severity": "中", "status": "通过", "message": "API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 正确以'/api/'开头;API路径 '/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 包含版本标识: 'v1'", "duration_seconds": 0.023859583016019315, "timestamp": "2025-06-20T10:38:53.106330", "validation_points": [ { "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}" }, { "pattern_matched": "/v\\d+/", "version_string": "v1", "full_path": "/api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}" } ] }, { "test_case_id": "TC-SECURITY-001", "test_case_name": "HTTPS Protocol Mandatory Verification", "test_case_severity": "严重", "status": "失败", "message": "API通过HTTP (http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0/example_id) 响应了成功的状态码 200,这违反了HTTPS强制策略。", "duration_seconds": 0.024642208009026945, "timestamp": "2025-06-20T10:38:53.131158", "validation_points": [ { "status_code": 200 } ] }, { "test_case_id": "TC-ERROR-4001-QUERY", "test_case_name": "Error Code -1 - Query Parameter Type Mismatch Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:在查询参数中未找到合适的字段来测试类型不匹配。", "duration_seconds": 0.026358041970524937, "timestamp": "2025-06-20T10:38:53.157611", "validation_points": [ { "passed": true, "message": "跳过测试:在查询参数中未找到合适的字段来测试类型不匹配。" } ] }, { "test_case_id": "TC-ERROR-4001-BODY", "test_case_name": "Error Code -1 - Request Body Type Mismatch Validation", "test_case_severity": "中", "status": "失败", "message": "当请求体字段 'isSearchCount' 类型不匹配时, 业务错误码应为 -1,但实际为 51。", "duration_seconds": 0.029199042008258402, "timestamp": "2025-06-20T10:38:53.186906", "validation_points": [ { "expected_code": -1, "actual_code": 51, "response_body": { "code": 51, "message": "ut", "data": { "total": 93, "list": [ { "dsid": "66", "dataRegion": "enim in voluptate", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null } ] } } } ] }, { "test_case_id": "TC-ERROR-4002", "test_case_name": "Error Code -1 - Number Value Out of Range Validation", "test_case_severity": "中", "status": "通过", "message": "跳过测试:未找到具有明确范围限制的数值字段。", "duration_seconds": 0.02757999999448657, "timestamp": "2025-06-20T10:38:53.214591", "validation_points": [ { "passed": true, "message": "跳过测试:未找到具有明确范围限制的数值字段。" } ] }, { "test_case_id": "TC-ERROR-4006", "test_case_name": "Error Code 4006 - Invalid Enum Value Validation", "test_case_severity": "中", "status": "失败", "message": "当 body 字段 'logic' 值为 'invalid_enum_uy507l' (合法值为: ['AND', 'OR']) 时, 业务错误码应为 -1,但实际为 4。", "duration_seconds": 0.03065541700925678, "timestamp": "2025-06-20T10:38:53.245355", "validation_points": [ { "expected_code": -1, "actual_code": 4, "response_body": { "code": 4, "message": "esse dolore sed", "data": { "total": 1, "list": [ { "dsid": "89", "dataRegion": "sunt mollit Lorem", "gasReleaseMon": null, "gasReleaseYear": null, "releaseGasCum": null } ] } } } ] }, { "test_case_id": "TC-ERROR-4003-BODY", "test_case_name": "Error Code -1 - Missing Required Request Body Field Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。", "duration_seconds": 0.026204333000350744, "timestamp": "2025-06-20T10:38:53.271756", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填请求体字段用于移除测试。" } ] }, { "test_case_id": "TC-ERROR-4003-QUERY", "test_case_name": "Error Code -1 - Missing Required Query Parameter Validation", "test_case_severity": "高", "status": "通过", "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。", "duration_seconds": 0.024508624977897853, "timestamp": "2025-06-20T10:38:53.296363", "validation_points": [ { "passed": true, "message": "跳过测试:在API规范中未找到合适的必填查询参数用于移除测试。" } ] } ] } ], "stage_results": [ { "stage_id": "generic_crud_validation_stage", "stage_name": "Generic CRUD Validation Stage", "description": "Performs a generic CRUD (Create, List, Read, Update, Delete) flow. It tries to dynamically discover API operations based on common keywords and HTTP methods. Field names for IDs, names, features, and JSON paths for list/detail objects are configurable via class attributes or can be set in `before_stage` based on `api_group_name`.", "api_group_name": "地质单元", "tags": [ "crud", "generic_validation" ], "overall_status": "失败", "duration_seconds": "0.05", "start_time": "2025-06-20T10:38:53", "end_time": "2025-06-20T10:38:53", "message": "测试阶段因步骤 'List and Find Created Resource' 的状态 (失败) 而中止.", "executed_steps_count": 2, "executed_steps": [ { "step_name": "Create New Resource", "description": null, "lookup_key": "地质单元数据添加", "resolved_endpoint": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit", "status": "通过", "message": "", "duration_seconds": "0.0000", "timestamp": "2025-06-20T10:38:53+0800", "validation_points": [ { "passed": true, "message": "状态码匹配 (200)." } ], "api_call_curl": "N/A", "request_details": { "method": "POST", "url": "http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/your_dms_instance_code/v1/cd_geo_unit", "headers": { "tenant-id": "your-tenant-id", "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer your-test-token" }, "params": {}, "json_data": { "version": "1.0.0", "data": [ { "wellCommonName": "TestResource_1750387133_207b0e", "dataRegion": "Feature_1750387133" } ] }, "body": { "version": "1.0.0", "data": [ { "wellCommonName": "TestResource_1750387133_207b0e", "dataRegion": "Feature_1750387133" } ] }, "data": null, "timeout": 30 }, "extracted_outputs": {}, "context_after_step_summary": { "unique_resource_name": "TestResource_1750387133_207b0e", "updated_resource_name": "TestResource_1750387133_207b0e_UPDATED", "unique_feature_value": "Feature_1750387133", "updated_feature_value": "Feature_1750387133_UPDATED", "cfg_list_path_in_listresponse": "data.list", "cfg_name_field_in_listitem": "wellCommonName", "cfg_id_field_in_listitem": "dsid", "cfg_resource_object_path_in_detailresponse": "data.list.0", "cfg_name_field_in_detailresponse": "wellCommonName", "cfg_id_field_in_detailresponse": "dsid", "cfg_resource_object_path_in_updateresponse": "data.list.0", "cfg_feature_field_name_for_validation": "dataRegion", "dms_instance_code": "your_dms_instance_code", "api_version": "1.0.0" } }, { "step_name": "List and Find Created Resource", "description": null, "lookup_key": "地质单元列表查询", "resolved_endpoint": "POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}", "status": "失败", "message": "Resource not found: Name 'TestResource_1750387133_207b0e' (field: wellCommonName) not found in list at path 'data.list'.", "duration_seconds": "0.0000", "timestamp": "2025-06-20T10:38:53+0800", "validation_points": [ { "passed": true, "message": "状态码匹配 (200)." }, { "passed": false, "message": "Resource not found: Name 'TestResource_1750387133_207b0e' (field: wellCommonName) not found in list at path 'data.list'." } ], "api_call_curl": "N/A", "request_details": { "method": "POST", "url": "http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/your_dms_instance_code/v1/cd_geo_unit/1.0.0", "headers": { "tenant-id": "your-tenant-id", "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer your-test-token" }, "params": { "pageNo": 1, "pageSize": 10 }, "json_data": { "isSearchCount": true, "query": { "fields": [ "dsid", "wellCommonName", "dataRegion" ], "filter": { "key": "wellCommonName", "symbol": "=", "realValue": [ "TestResource_1750387133_207b0e" ] } } }, "body": { "isSearchCount": true, "query": { "fields": [ "dsid", "wellCommonName", "dataRegion" ], "filter": { "key": "wellCommonName", "symbol": "=", "realValue": [ "TestResource_1750387133_207b0e" ] } } }, "data": null, "timeout": 30 }, "extracted_outputs": {}, "context_after_step_summary": { "unique_resource_name": "TestResource_1750387133_207b0e", "updated_resource_name": "TestResource_1750387133_207b0e_UPDATED", "unique_feature_value": "Feature_1750387133", "updated_feature_value": "Feature_1750387133_UPDATED", "cfg_list_path_in_listresponse": "data.list", "cfg_name_field_in_listitem": "wellCommonName", "cfg_id_field_in_listitem": "dsid", "cfg_resource_object_path_in_detailresponse": "data.list.0", "cfg_name_field_in_detailresponse": "wellCommonName", "cfg_id_field_in_detailresponse": "dsid", "cfg_resource_object_path_in_updateresponse": "data.list.0", "cfg_feature_field_name_for_validation": "dataRegion", "dms_instance_code": "your_dms_instance_code", "api_version": "1.0.0" } } ], "final_stage_context_summary": { "unique_resource_name": "TestResource_1750387133_207b0e", "updated_resource_name": "TestResource_1750387133_207b0e_UPDATED", "unique_feature_value": "Feature_1750387133", "updated_feature_value": "Feature_1750387133_UPDATED", "cfg_list_path_in_listresponse": "data.list", "cfg_name_field_in_listitem": "wellCommonName", "cfg_id_field_in_listitem": "dsid", "cfg_resource_object_path_in_detailresponse": "data.list.0", "cfg_name_field_in_detailresponse": "wellCommonName", "cfg_id_field_in_detailresponse": "dsid", "cfg_resource_object_path_in_updateresponse": "data.list.0", "cfg_feature_field_name_for_validation": "dataRegion", "dms_instance_code": "your_dms_instance_code", "api_version": "1.0.0" } } ], "api_call_details_summary": [] }