zjncs opened a new pull request, #5763:
URL: https://github.com/apache/rocketmq-dashboard/pull/5763
### What
`AlertRuleListItem` — the tool-side listing projection of an alert rule —
had no test. This adds `AlertRuleListItemTest` with 4 tests.
### What is pinned
- every listing field maps through: identity, the metric condition (metric,
operator, threshold, unit), the duration, the notification channels, the
enabled flag and the description;
- **a rule saved before the channels field existed lists with an empty
channel set**, not null and not a crash — the compact constructor normalises;
- an explicitly null channels set passed to the record directly also
normalises to empty;
- a disabled rule lists as disabled.
### Verification
- New tests on unmodified code: **4/4 green**, checkstyle clean (`mvn test
-Dtest=AlertRuleListItemTest`).
- Discriminating mutations on `AlertRuleListItem`, build result verified red
each time:
1. the channels null-safety dropped from the compact constructor — red;
2. the enabled flag inverted in `from()` so paused rules list as active —
red;
3. the threshold zeroed so every listed rule reads as alert-at-zero — red.
- Restored: 4/4 green. Test-only change; no product code touched.
--
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]