From d40ed80eac8ab6a131d84c33eb88d19f69c13e22 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar K J Date: Thu, 26 Jan 2023 16:53:52 +0530 Subject: [PATCH] update tests --- crates/core/c8y_api/src/json_c8y.rs | 6 +++--- crates/core/tedge_mapper/src/c8y/tests.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/core/c8y_api/src/json_c8y.rs b/crates/core/c8y_api/src/json_c8y.rs index d740ae568f7..855cef10f95 100644 --- a/crates/core/c8y_api/src/json_c8y.rs +++ b/crates/core/c8y_api/src/json_c8y.rs @@ -588,7 +588,7 @@ mod tests { source: None, }, C8yCreateAlarm { - severity: "critical".to_string(), + severity: "CRITICAL".to_string(), source: None, alarm_type: "temperature alarm".into(), time: datetime!(2021-04-23 19:00:00 +05:00), @@ -609,7 +609,7 @@ mod tests { source: None, }, C8yCreateAlarm { - severity: "critical".to_string(), + severity: "CRITICAL".to_string(), source: None, alarm_type: "temperature alarm".into(), time: datetime!(2021-04-23 19:00:00 +05:00), @@ -630,7 +630,7 @@ mod tests { source: Some("external_source".into()), }, C8yCreateAlarm { - severity: "critical".to_string(), + severity: "CRITICAL".to_string(), source: Some(SourceInfo::new("external_source".to_string(),"c8y_Serial".to_string())), alarm_type: "temperature alarm".into(), time: datetime!(2021-04-23 19:00:00 +05:00), diff --git a/crates/core/tedge_mapper/src/c8y/tests.rs b/crates/core/tedge_mapper/src/c8y/tests.rs index 146b84c99eb..db1359058d2 100644 --- a/crates/core/tedge_mapper/src/c8y/tests.rs +++ b/crates/core/tedge_mapper/src/c8y/tests.rs @@ -461,7 +461,7 @@ async fn c8y_mapper_alarm_with_custom_fragment_mapping_to_c8y_json() { .await .unwrap(); - let expected_msg = json!({"severity":"major","type":"temperature_alarm","time":"2023-01-25T18:41:14.776170774Z","text":"Temperature high","customFragment":{"nested":{"value":"extra info"}}}); + let expected_msg = json!({"severity":"MAJOR","type":"temperature_alarm","time":"2023-01-25T18:41:14.776170774Z","text":"Temperature high","customFragment":{"nested":{"value":"extra info"}}}); while let Ok(Some(msg)) = messages.next().with_timeout(TEST_TIMEOUT_MS).await { assert_json_include!(actual:serde_json::from_str::(&msg).unwrap(), expected:expected_msg); @@ -503,7 +503,7 @@ async fn c8y_mapper_child_alarm_with_custom_fragment_mapping_to_c8y_json() { .await .unwrap(); - let expected_msg = json!({"severity":"major","type":"temperature_alarm","time":"2023-01-25T18:41:14.776170774Z","text":"Temperature high","externalSource":{"externalId":"external_sensor","type":"c8y_Serial"},"customFragment":{"nested":{"value":"extra info"}}}); + let expected_msg = json!({"severity":"MAJOR","type":"temperature_alarm","time":"2023-01-25T18:41:14.776170774Z","text":"Temperature high","externalSource":{"externalId":"external_sensor","type":"c8y_Serial"},"customFragment":{"nested":{"value":"extra info"}}}); while let Ok(Some(msg)) = messages.next().with_timeout(TEST_TIMEOUT_MS).await { assert_json_include!(actual:serde_json::from_str::(&msg).unwrap(), expected:expected_msg);