Skip to content

Commit

Permalink
Replaced harcoded 5GCroCo by default
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Buffon <[email protected]>
  • Loading branch information
nbuffon committed Nov 7, 2024
1 parent 768cd70 commit dbd3c68
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rust/libits-client/src/mqtt/topic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl Topic {
T: Into<MessageType> + Default,
{
Topic {
project: "5GCroCo".to_string(),
project: "default".to_string(),
queue: match queue {
Some(into_queue) => into_queue.into(),
None => Queue::default(),
Expand Down Expand Up @@ -205,11 +205,11 @@ mod tests {

#[test]
fn test_cam_topic_from_str() {
let topic_string = "5GCroCo/outQueue/v2x/cam/car_1/0/1/2/3";
let topic_string = "default/outQueue/v2x/cam/car_1/0/1/2/3";
let topic_result = Topic::from_str(topic_string);
assert!(topic_result.is_ok());
let topic = topic_result.unwrap();
assert_eq!(topic.project, "5GCroCo".to_string());
assert_eq!(topic.project, "default".to_string());
assert_eq!(topic.queue, Queue::Out);
assert_eq!(topic.server, "v2x".to_string());
assert_eq!(topic.message_type, MessageType::CAM);
Expand All @@ -223,11 +223,11 @@ mod tests {
#[test]
fn test_denm_topic_from_str() {
let topic_string =
"5GCroCo/outQueue/v2x/denm/wse_app_bcn1/1/2/0/2/2/2/2/3/3/0/0/3/2/0/2/0/1/0/1/0/3/1/";
"default/outQueue/v2x/denm/wse_app_bcn1/1/2/0/2/2/2/2/3/3/0/0/3/2/0/2/0/1/0/1/0/3/1/";
let topic_result = Topic::from_str(topic_string);
assert!(topic_result.is_ok());
let topic = topic_result.unwrap();
assert_eq!(topic.project, "5GCroCo".to_string());
assert_eq!(topic.project, "default".to_string());
assert_eq!(topic.queue, Queue::Out);
assert_eq!(topic.server, "v2x".to_string());
assert_eq!(topic.message_type, MessageType::DENM);
Expand All @@ -237,11 +237,11 @@ mod tests {

#[test]
fn test_info_topic_from_str() {
let topic_string = "5GCroCo/outQueue/v2x/info/broker";
let topic_string = "default/outQueue/v2x/info/broker";
let topic_result = Topic::from_str(topic_string);
assert!(topic_result.is_ok());
let topic = topic_result.unwrap();
assert_eq!(topic.project, "5GCroCo".to_string());
assert_eq!(topic.project, "default".to_string());
assert_eq!(topic.queue, Queue::Out);
assert_eq!(topic.server, "v2x".to_string());
assert_eq!(topic.message_type, MessageType::INFO);
Expand All @@ -251,11 +251,11 @@ mod tests {

#[test]
fn test_in_queue_cam_topic_from_str() {
let topic_string = "5GCroCo/inQueue/v2x/cam/car_1/0/1/2/3";
let topic_string = "default/inQueue/v2x/cam/car_1/0/1/2/3";
let topic_result = Topic::from_str(topic_string);
assert!(topic_result.is_ok());
let topic = topic_result.unwrap();
assert_eq!(topic.project, "5GCroCo".to_string());
assert_eq!(topic.project, "default".to_string());
assert_eq!(topic.queue, Queue::In);
assert_eq!(topic.server, "v2x".to_string());
assert_eq!(topic.message_type, MessageType::CAM);
Expand Down

0 comments on commit dbd3c68

Please sign in to comment.