Skip to content

test(identity): 补齐身份边界用例并收口合并键/加签查重(#295) - #299

Merged
xlorne merged 1 commit into
devfrom
feature/issue-295-identity-tests
Dec 2, 2026
Merged

xlorne merged 1 commit into
devfrom
feature/issue-295-identity-tests

Conversation

@xlorne

@xlorne xlorne commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

背景

issue #295 逐项核对后仍有 4 类身份缺口无用例(撤回/催办/子流程重置、加签减签、转交/干预落库、同人自动通过)。本轮除补用例,还收口了两处「按人 vs 按身份」不一致的实现。

改动

实现(2 处)

  • FlowRecord#getTodoKey():合并键改为由 OperatorIdentityPolicy 决定——USER_ONLY 下身份不进键(按人合并,避免同一人出现两条重复待办),STRICT 下保持历史兼容追加格式。
  • AddAuditAction#verifyNotInTodoQueue:查重从「userId + identity 复合键」改为 OperatorIdentityPolicy.matches——USER_ONLY 下同人换身份视为同一人,拒绝重复加签。

用例(15 例)

  • 新增 OperatorIdentityBoundaryTest(13 例):
    • 缺口 2:撤回 / 催办的身份归属(USER_ONLY 放行、STRICT 拒绝)
    • 缺口 3:加签同人异身份查重、减签身份维度(成功 vs 目标不存在)
    • 缺口 4:转交目标身份落库、转交链 forwardOperatorIdentity 落库、同人换身份不记干预
    • 缺口 7:同人自动通过的身份过滤(USER_ONLY 自动通过、STRICT 保留待办)
  • FlowSubProcessResetServiceTest 补 2 例:子流程重置的身份归属校验。

文档

  • docs/Integration/operator-identity.md:4.2 合并键改为按模式说明,4.4 覆盖面补加签查重,5.1 待办合并行标注模式。

验证

./mvnw -o clean install:7 模块 SUCCESS,505 个用例 0 失败 0 跳过(framework 480 / starter-infra 6 / starter-api 2 / starter 10 / example 7),本轮新增 15 例。

Closes #295

- 待办合并键由匹配模式决定:USER_ONLY 按人合并(身份不进键),STRICT 保持
  历史兼容追加格式,避免同一人出现两条重复待办
- 加签「是否已在待办队列」改由 OperatorIdentityPolicy 判定:USER_ONLY 下
  同人换身份视为同一人,拒绝重复加签;STRICT 下仍按 (人, 身份) 区分
- 新增 OperatorIdentityBoundaryTest(13 例):撤回/催办、加签/减签、
  转交与干预留痕、同人自动通过的 USER_ONLY / STRICT 双模式断言
- FlowSubProcessResetServiceTest 补 2 例:子流程重置的身份归属校验
- 同步 operator-identity.md 4.2 / 4.4 / 5.1 口径
@xlorne
xlorne merged commit 9736e92 into dev Dec 2, 2026
1 check passed
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.19%. Comparing base (4273f1b) to head (5573905).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
.../codingapi/flow/action/actions/AddAuditAction.java 75.00% 1 Missing and 1 partial ⚠️
...ain/java/com/codingapi/flow/record/FlowRecord.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #299      +/-   ##
============================================
+ Coverage     76.16%   76.19%   +0.03%     
- Complexity     2123     2124       +1     
============================================
  Files           282      282              
  Lines          8648     8651       +3     
  Branches       1027     1028       +1     
============================================
+ Hits           6587     6592       +5     
+ Misses         1552     1550       -2     
  Partials        509      509              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xlorne
xlorne deleted the feature/issue-295-identity-tests branch December 2, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant