Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PradeepKiruvale committed Jan 26, 2023
1 parent 8d4b981 commit d40ed80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/core/c8y_api/src/json_c8y.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions crates/core/tedge_mapper/src/c8y/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<serde_json::Value>(&msg).unwrap(), expected:expected_msg);
Expand Down Expand Up @@ -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::<serde_json::Value>(&msg).unwrap(), expected:expected_msg);
Expand Down

0 comments on commit d40ed80

Please sign in to comment.