yyqdbngt opened a new pull request, #3253: URL: https://github.com/apache/rocketmq-dashboard/pull/3253
## Summary Adds `NativeAlertEvaluationServiceTest`, pure unit coverage (no Spring context) for the per-evaluation transaction that aggregates a native sample, advances alert state, persists the lifecycle event, and enqueues notifications. All collaborators are mocked. Coverage: - a non-matching rule returns without touching state, snapshot, alert, outbox, or suppression collaborators; - window aggregation per rule: `MAX`/`MIN`/`AVG`/`SUM`/`LAST` (case-insensitive, null → `LAST`) applied to the snapshot window fetched since `collectedAt - windowSeconds`, while unavailable samples and windowless rules skip the lookup entirely; - a firing evaluation persists an event with the severity→level mapping (`critical`→error, `warning`→warning, anything else→info), the correct description/fingerprint/transition/instance fields, marks the rule triggered, and enqueues the notification; - a BUSINESS firing/reminder alert is suppressed (with cause id and reason) while a cluster incident is active, and the outbox is skipped; - CLUSTER-domain alerts are never suppression-checked; - non-emitting transitions (e.g. `PENDING`) persist the state but skip event persistence and enqueue. ## Why The service decides whether a native sample becomes an alert event and which notifications are enqueued; existing coverage only exercises transaction rollback semantics via `@SpringBootTest`, not these branches. ## Testing `mvn -B test -Dtest=NativeAlertEvaluationServiceTest` — 8/8 pass; checkstyle (validate) clean. -- 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]
