use of org.flyte.localengine.examples.StructWorkflow in project flytekit-java by flyteorg.
the class LocalEngineTest method testStructWorkflow.
@Test
public void testStructWorkflow() {
String workflowName = new StructWorkflow().getName();
Map<String, WorkflowTemplate> workflows = loadWorkflows();
Map<String, RunnableTask> tasks = loadTasks();
WorkflowTemplate workflow = workflows.get(workflowName);
Literal inputStructLiteral = Literal.ofScalar(Scalar.ofGeneric(Struct.of(ImmutableMap.of("someKey1", Struct.Value.ofStringValue("some_value_1"), "someKey2", Struct.Value.ofBoolValue(true)))));
Map<String, Literal> inputs = ImmutableMap.of("someString", Literal.ofScalar(Scalar.ofPrimitive(Primitive.ofStringValue("some_string_value"))), "someStruct", inputStructLiteral);
Map<String, Literal> outputs = LocalEngine.compileAndExecute(workflow, tasks, emptyMap(), inputs);
Literal expectedOutput = Literal.ofScalar(Scalar.ofGeneric(Struct.of(ImmutableMap.of("someKey1", Struct.Value.ofStringValue("some_value_1-output"), "someKey2", Struct.Value.ofBoolValue(true)))));
assertEquals(expectedOutput, outputs.get("outputStructData"));
}
Aggregations