test: 提升ShareTrackingService测试覆盖率到100% - 新增3个边界测试

- 新增空白referer和userAgent的转化漏斗测试
- 新增null IP和null params的指标测试
- 新增null params的点击记录测试

覆盖率提升:
- ShareTrackingService: 82% → 100% (+18%) 
- Service包: 87% → 89% (+2%)
- 总体分支覆盖率: 64.5% → 65.3% (+0.8%)
- 新增覆盖分支: 5个
- 距离70%目标: 还需29个分支
This commit is contained in:
Your Name
2026-03-03 16:54:54 +08:00
parent 52175fde22
commit f92818c73e
2 changed files with 96 additions and 1 deletions

View File

@@ -105,7 +105,9 @@
"Bash(mvn test -Dtest=ActivityServiceCoverageTest 2>&1 | tail -30)",
"Bash(mvn test -Dtest=ApiKeyEncryptionServiceTest -q)",
"Bash(grep -E \"Tests run:|BUILD\" target/surefire-reports/*.txt 2>/dev/null | tail -5 || echo \"检查测试结果...\")",
"Bash(git add -A && git commit -m \"test: 提升ApiKeyEncryptionService测试覆盖率 - 新增4个边界测试\n\n- 新增legacy默认密钥在生产环境的测试\n- 新增空白密钥在生产环境的测试\n- 新增environment为null的场景测试\n- 新增非生产环境允许默认密钥的测试\n\n覆盖率提升:\n- ApiKeyEncryptionService: 73% → 84% \\(+11%\\)\n- Service包: 86% → 87% \\(+1%\\)\n- 总体分支覆盖率: 64.1% → 64.5% \\(+0.4%\\)\n- 新增覆盖分支: 3个\n- 距离70%目标: 还需34个分支\")"
"Bash(git add -A && git commit -m \"test: 提升ApiKeyEncryptionService测试覆盖率 - 新增4个边界测试\n\n- 新增legacy默认密钥在生产环境的测试\n- 新增空白密钥在生产环境的测试\n- 新增environment为null的场景测试\n- 新增非生产环境允许默认密钥的测试\n\n覆盖率提升:\n- ApiKeyEncryptionService: 73% → 84% \\(+11%\\)\n- Service包: 86% → 87% \\(+1%\\)\n- 总体分支覆盖率: 64.1% → 64.5% \\(+0.4%\\)\n- 新增覆盖分支: 3个\n- 距离70%目标: 还需34个分支\")",
"Bash(mvn test -Dtest=ShareTrackingServiceTest -q)",
"Bash(git add -A && git commit -m \"test: 提升ShareTrackingService测试覆盖率到100% - 新增3个边界测试\n\n- 新增空白referer和userAgent的转化漏斗测试\n- 新增null IP和null params的指标测试\n- 新增null params的点击记录测试\n\n覆盖率提升:\n- ShareTrackingService: 82% → 100% \\(+18%\\) ✨\n- Service包: 87% → 89% \\(+2%\\)\n- 总体分支覆盖率: 64.5% → 65.3% \\(+0.8%\\)\n- 新增覆盖分支: 5个\n- 距离70%目标: 还需29个分支\")"
]
}
}