yyqdbngt opened a new pull request, #3587:
URL: https://github.com/apache/rocketmq-dashboard/pull/3587
### Summary
Adds the first dedicated unit test suite for `AlertRuleRequestDTO`, the
validated write payload of the alert rule endpoints.
The DTO enforces operator/duration/aggregation/severity/channel whitelists
plus numeric bounds, and normalizes fields when projecting to `AlertRuleVO`.
The tests cover every validation branch and the mapping defaults.
### Changes
-
`server/src/test/java/org/apache/rocketmq/studio/ops/alert/AlertRuleRequestDTOTest.java`
- Validation: blank name, unknown operator, UNAVAILABLE accepted,
malformed duration, unknown aggregation, negative windowSeconds, unknown
severity, blank/unknown channels, zero consecutiveSamples, malformed
reminderInterval, overlong notification template.
- `mappingAppliesDefaultsAndNormalization`: metric trimming, LAST/0/1/30m
defaults and channel trim/dedupe/blank filtering.
### Testing
- `mvn -B test -Dtest=AlertRuleRequestDTOTest` passes (13 tests, all green).
--
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]