yyqdbngt opened a new pull request, #3268: URL: https://github.com/apache/rocketmq-dashboard/pull/3268
## Summary Extends the existing `MetricSampleTest` (2 to 6 tests) to pin down the remaining branches of the sample record contract. Added cases: - missing/blank `metricKey` and blank `instanceId` are rejected with their messages, and null `domain`, `availability`, and `collectedAt` fail fast with NPEs carrying the field name; - an available sample cannot carry an unavailable reason; - labels are defensively copied into an unmodifiable snapshot (later source mutation does not leak in), and null labels normalize to an empty map; - unavailable samples carry their reason through the full constructor, while the convenience constructor leaves the reason null. ## Why The record is the unit that flows through native collection, snapshots, and alert evaluation; only the value-availability invariants were covered before. ## Testing `mvn -B test -Dtest=MetricSampleTest` — 6/6 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]
