Skip to content

Commit 0015f9a

Browse files
committed
Apply fjtirado pull request suggestion
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
1 parent 1b4d6fc commit 0015f9a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

impl/test/src/test/java/io/serverlessworkflow/impl/test/FuncDSLEnrichWithTest.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,28 @@ void test_export_as_with_taskInput_utility() {
171171

172172
softly.assertAll();
173173
}
174+
175+
@Test
176+
void test_using_fluent() {
177+
SoftAssertions softly = new SoftAssertions();
178+
179+
Workflow workflow =
180+
FuncWorkflowBuilder.workflow("enrichOutputWithInputTest")
181+
.tasks(
182+
function("sumFive", (Long input) -> input + 5, Long.class)
183+
.inputFrom(
184+
(object, workflowContext, taskContextData) ->
185+
taskOutput(taskContextData, Long.class) * 2))
186+
.build();
187+
188+
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
189+
WorkflowDefinition def = app.workflowDefinition(workflow);
190+
WorkflowModel model = def.instance(10L).start().join();
191+
Number number = model.asNumber().orElseThrow();
192+
193+
softly.assertThat(number.longValue()).isEqualTo(25L);
194+
}
195+
196+
softly.assertAll();
197+
}
174198
}

0 commit comments

Comments
 (0)