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:
+1
-1
@@ -47,9 +47,9 @@ import java.util.function.Consumer;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.AcknowledgeAlarmReply;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.AcknowledgeAlarmRequest;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.ActiveAlarmSnapshot;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.AlarmFeedMessage;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.AlarmProviderStatus;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.AlarmSnapshotStatus;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.AlarmFeedMessage;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.BulkReadResult;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.BulkWriteResult;
|
||||
import mxaccess_gateway.v1.MxaccessGateway.CloseSessionRequest;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user