Skip to content

Commit

Permalink
Add get_server_info test case
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeling committed Oct 22, 2024
1 parent 890fdca commit 12fee41
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions databroker/src/grpc/kuksa_val_v2/val.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2707,4 +2707,27 @@ mod tests {
}
}
}

#[tokio::test]
async fn test_get_server_info() {
let version = "1.1.1";
let commit_hash = "3a3c332f5427f2db7a0b8582262c9f5089036c23";
let broker = DataBroker::new(version, commit_hash);

let request = tonic::Request::new(proto::GetServerInfoRequest {});

match proto::val_server::Val::get_server_info(&broker, request)
.await
.map(|res| res.into_inner())
{
Ok(response) => {
assert_eq!(response.name, "databroker");
assert_eq!(response.version, version);
assert_eq!(response.commit_hash, commit_hash);
}
Err(_) => {
panic!("Should not happen")
}
}
}
}

0 comments on commit 12fee41

Please sign in to comment.