zjncs opened a new pull request, #5678:
URL: https://github.com/apache/rocketmq-dashboard/pull/5678

   ### Problem
   
   `MybatisPlusAiRunRepository` — the MySQL-backed `rmq_ai_run` access — had 
**no test**.
   
   ### Change
   
   Add `MybatisPlusAiRunRepositoryTest` with fifteen tests (mapper mocked, no 
database):
   
   | Contract | Pinned behaviour |
   | --- | --- |
   | null guards | a null id / conversation / status collection / id list 
returns empty **without touching the mapper** — the guards are load-bearing |
   | active lookup | goes through the mapper using the shared 
`RunStatus.ACTIVE_STATUSES` vocabulary |
   | page aggregation | `findLatestByConversationIds` answers a whole page with 
**exactly two statements** (one `MAX(id)` group-by plus one `selectList`), 
never one query per conversation |
   | tie-break | an unexpected duplicate breaks towards the **newer** 
(higher-id) run — a corrupt result cannot silently report the older run as the 
conversation's last |
   | dirty data | rows without a conversation id are skipped, not keyed; null 
ids in the input are filtered before any query runs |
   | short-circuit | an empty `MAX(id)` result skips the second query entirely |
   | maxTurn | coalesces an empty result and an explicit SQL `null` to zero; a 
null conversation never queries |
   
   ### Verification
   
   - New tests: **15/15 green** against unmodified code.
   - Discriminating mutations on the repository (build result verified): 
null-id guard dropped (**red**); the empty-aggregation early return dropped 
(**red**); the tie-break flipped to the older run (**red**); the maxTurn null 
coalesce dropped (**red**); the null-conversation row skip dropped (**red**).
   - Restored: 15/15 green. No product code changed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to