Skip to content

Commit 53456a0

Browse files
committed
feat: added REST identifier to get_flow_identifer
1 parent d2f209e commit 53456a0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/flow_store/flow_identifier.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use tucana::shared::{value::Kind, Flow, FlowSetting};
1+
use tucana::shared::{Flow, FlowSetting, value::Kind};
22

33
fn extract_field(settings: &[FlowSetting], def_key: &str, field_name: &str) -> Option<String> {
44
settings.iter().find_map(|setting| {
@@ -20,7 +20,7 @@ fn extract_field(settings: &[FlowSetting], def_key: &str, field_name: &str) -> O
2020
}
2121

2222
/// Every flow identifier needs to start with its
23-
/// flow_id::project_id::protocol_specific_fields
23+
/// flow_id::project_id::flow_identifier::protocol_specific_fields
2424
pub fn get_flow_identifier(flow: &Flow) -> Option<String> {
2525
match flow.r#type.as_str() {
2626
"REST" => {
@@ -36,7 +36,7 @@ pub fn get_flow_identifier(flow: &Flow) -> Option<String> {
3636
};
3737

3838
Some(format!(
39-
"{}::{}::{}::{}",
39+
"{}::{}::REST::{}::{}",
4040
flow.flow_id, flow.project_id, host, method
4141
))
4242
}
@@ -119,7 +119,7 @@ mod test {
119119
let id = get_flow_identifier(&rest);
120120

121121
assert!(id.is_some());
122-
assert_eq!(id.unwrap(), String::from("1::1::abc.code0.tech::GET"))
122+
assert_eq!(id.unwrap(), String::from("1::1::REST::abc.code0.tech::GET"))
123123
}
124124

125125
#[test]

src/flow_store/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,16 @@ impl FlowStoreServiceBase for FlowStoreService {
207207
mod tests {
208208
use std::collections::HashMap;
209209

210-
use crate::flow_store::connection::create_flow_store_connection;
211210
use crate::flow_store::connection::FlowStore;
211+
use crate::flow_store::connection::create_flow_store_connection;
212212
use crate::flow_store::service::FlowStoreService;
213213
use crate::flow_store::service::FlowStoreServiceBase;
214214
use redis::{AsyncCommands, JsonAsyncCommands};
215215
use serial_test::serial;
216+
use testcontainers::GenericImage;
216217
use testcontainers::core::IntoContainerPort;
217218
use testcontainers::core::WaitFor;
218219
use testcontainers::runners::AsyncRunner;
219-
use testcontainers::GenericImage;
220220
use tucana::shared::FlowSetting;
221221
use tucana::shared::FlowSettingDefinition;
222222
use tucana::shared::Struct;

0 commit comments

Comments
 (0)