swf-runtime 1.0.0-alpha8

Runtime engine for Serverless Workflow DSL — execute, validate, and orchestrate workflows
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(test)]
pub(crate) mod test_helpers {
    use serde_json::Value;
    use std::collections::HashMap;
    use swf_core::models::task::{
        SetTaskDefinition, SetValue, TaskDefinition, TaskDefinitionFields,
    };

    /// Creates a Set task that sets a single key to a value
    pub fn make_set_task(key: &str, value: impl Into<Value>) -> TaskDefinition {
        let mut map = HashMap::new();
        map.insert(key.to_string(), value.into());
        TaskDefinition::Set(SetTaskDefinition {
            set: SetValue::Map(map),
            common: TaskDefinitionFields::new(),
        })
    }
}