Skip to content

Commit a8a5c83

Browse files
committed
Apply pull request suggestions from github copilot
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
1 parent 90df169 commit a8a5c83

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncDSL.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public static FuncPredicateEventConfigurer event(String type) {
292292
* <pre>{@code
293293
* function("processData", (Long input) -> input + 5, Long.class),
294294
* function("combineData", (Long enrichedValue) -> enrichedValue, Long.class)
295-
* .enrichInputWith((lastState, rootInputModel) -> {
295+
* .inputFrom(enriched((lastState, rootInputModel) -> {
296296
* Long rootInput = rootInputModel.as(Long.class).orElse(0L);
297297
* return lastState + rootInput;
298298
* }, Long.class)
@@ -322,7 +322,7 @@ public static <T, R> JavaContextFunction<T, R> enriched(
322322
*
323323
* <pre>{@code
324324
* function("processData", (Long input) -> input * 2, Long.class)
325-
* .enrichWithInput(rootInput -> rootInput.asNumber().orElseThrow())
325+
* inputFrom(enriched(rootInput -> rootInput.asNumber().orElseThrow()))
326326
* }</pre>
327327
*
328328
* @param fn the function that receives the root workflow input and returns the enriched result
@@ -347,7 +347,7 @@ public static <R> JavaContextFunction<Object, R> enriched(Function<WorkflowModel
347347
*
348348
* <pre>{@code
349349
* function("processData", (Long input) -> input + 5, Long.class)
350-
* .outputAs(FuncDSL.enrichWithModel((taskOutput, rootInputModel) -> {
350+
* .outputAs(FuncDSL.enrichedOutput((taskOutput, rootInputModel) -> {
351351
* Long rootInput = rootInputModel.as(Long.class).orElse(0L);
352352
* return taskOutput + rootInput;
353353
* }, Long.class))
@@ -377,7 +377,7 @@ public static <T, R> JavaContextFunction<T, R> enrichedOutput(
377377
*
378378
* <pre>{@code
379379
* function("processData", (Long input) -> input * 2, Long.class)
380-
* .outputAs(FuncDSL.enrichWithInput(rootInput -> rootInput.asNumber().orElseThrow()))
380+
* .outputAs(FuncDSL.enrichedOutput(rootInput -> rootInput.asNumber().orElseThrow()))
381381
* }</pre>
382382
*
383383
* @param fn the function that receives the root workflow input and returns the enriched result

experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
2323
import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
2424
import io.serverlessworkflow.fluent.spec.TaskBaseBuilder;
25-
2625
import java.util.ArrayList;
2726
import java.util.List;
2827
import java.util.function.Consumer;
@@ -226,5 +225,4 @@ public final void accept(FuncTaskItemListBuilder list) {
226225
private void applyPost(B builder) {
227226
for (Consumer<B> c : postConfigurers) c.accept(builder);
228227
}
229-
230228
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ void test_enrich_with_input_workflow() {
100100
Number number = model.asNumber().orElseThrow();
101101

102102
softly.assertThat(number).isEqualTo(10L);
103+
104+
softly.assertAll();
103105
}
104106

105107
@Test

0 commit comments

Comments
 (0)