Skip to content

Commit

Permalink
fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
wilyle committed Jan 9, 2024
1 parent a7a146f commit 71c4b5e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions provider_proxies/grpc/v1/src/grpc_client_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,27 @@ impl DigitalTwinConsumer for GRPCClientImpl {

#[cfg(test)]
mod grpc_client_impl_tests {
use freyja_common::signal::SignalPatch;

use super::*;

#[tokio::test]
async fn publish_test() {
let consumer_impl = GRPCClientImpl {
signals: Arc::new(SignalStore::new()),
};

let entity_id = String::from("some-id");
let value = String::from("some-value");

let signals = Arc::new(SignalStore::new());
signals.add([
SignalPatch {
id: entity_id.clone(),
..Default::default()
}
].into_iter());

let consumer_impl = GRPCClientImpl {
signals,
};

let request = tonic::Request::new(PublishRequest { entity_id, value });
let result = consumer_impl.publish(request).await;
assert!(result.is_ok());
Expand Down

0 comments on commit 71c4b5e

Please sign in to comment.