fix(clients): review nits — alphabetize the Java CLI alarm imports, cover the Rust snapshot-status render

The Java import block's AlarmFeedMessage already sorted after
AlarmProviderStatus before c748361; adding AlarmSnapshotStatus widened the
gap. Order all three alphabetically.

The Rust CLI tests the sibling ProviderStatus render path but not the new
SnapshotStatus arm, so the summary string and the JSON shape were both
uncovered. Add the matching test over alarm_feed_message_summary and
alarm_feed_message_to_json.
This commit is contained in:
Joseph Doherty
2026-08-18 05:33:00 -04:00
parent c7483615cf
commit 4d4f443c27
2 changed files with 20 additions and 1 deletions
+19
View File
@@ -2969,4 +2969,23 @@ mod tests {
assert_eq!(provider["reason"], "alarmmgr unavailable");
assert_eq!(provider["since"]["seconds"], 1_777_995_000_i64);
}
#[test]
fn alarm_feed_snapshot_status_renders_in_summary_and_json() {
use zb_mom_ww_mxgateway_client::generated::mxaccess_gateway::v1::{
alarm_feed_message, AlarmFeedMessage, AlarmSnapshotStatus,
};
let message = AlarmFeedMessage {
payload: Some(alarm_feed_message::Payload::SnapshotStatus(
AlarmSnapshotStatus { truncated: true },
)),
};
let summary = super::alarm_feed_message_summary(&message);
assert_eq!(summary, "snapshot-status truncated=true");
let value = super::alarm_feed_message_to_json(&message);
assert_eq!(value["snapshotStatus"]["truncated"], true);
}
}