Skip to content

Commit 30d03a3

Browse files
authored
Refactor experimental fluent dependencies (#1171)
It is better to keep the dsl test as they were and put the model test in the lambda module Signed-off-by: fjtirado <ftirados@redhat.com>
1 parent 3eada58 commit 30d03a3

File tree

3 files changed

+20
-31
lines changed

3 files changed

+20
-31
lines changed

experimental/fluent/func/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,5 @@
4545
<version>${version.org.mockito}</version>
4646
<scope>test</scope>
4747
</dependency>
48-
<dependency>
49-
<groupId>io.serverlessworkflow</groupId>
50-
<artifactId>serverlessworkflow-impl-model</artifactId>
51-
<version>${project.version}</version>
52-
<scope>test</scope>
53-
</dependency>
54-
<dependency>
55-
<groupId>io.serverlessworkflow</groupId>
56-
<artifactId>serverlessworkflow-impl-jackson</artifactId>
57-
<version>${project.version}</version>
58-
<scope>test</scope>
59-
</dependency>
6048
</dependencies>
6149
</project>

experimental/fluent/func/src/test/java/io/serverlessworkflow/fluent/func/FuncDSLTest.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import static io.serverlessworkflow.fluent.func.dsl.FuncDSL.http;
2424
import static io.serverlessworkflow.fluent.func.dsl.FuncDSL.listen;
2525
import static io.serverlessworkflow.fluent.func.dsl.FuncDSL.toOne;
26+
import static io.serverlessworkflow.fluent.spec.dsl.DSL.auth;
2627
import static io.serverlessworkflow.fluent.spec.dsl.DSL.use;
2728
import static org.junit.jupiter.api.Assertions.assertEquals;
2829
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
@@ -41,8 +42,6 @@
4142
import io.serverlessworkflow.fluent.func.dsl.FuncDSL;
4243
import io.serverlessworkflow.fluent.func.dsl.FuncEmitSpec;
4344
import io.serverlessworkflow.fluent.func.dsl.FuncListenSpec;
44-
import io.serverlessworkflow.impl.WorkflowApplication;
45-
import io.serverlessworkflow.impl.WorkflowDefinition;
4645
import java.net.URI;
4746
import java.nio.charset.StandardCharsets;
4847
import java.util.List;
@@ -433,21 +432,4 @@ void call_with_preconfigured_http_spec() {
433432
.getUse());
434433
assertEquals(Map.of("foo", "bar"), http.getWith().getBody());
435434
}
436-
437-
@Test
438-
void set_with_map() {
439-
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
440-
Workflow workflow =
441-
FuncWorkflowBuilder.workflow()
442-
.tasks(f -> f.set(s -> s.expr(Map.of("message", "hello world!"))))
443-
.build();
444-
445-
WorkflowDefinition workflowDefinition = app.workflowDefinition(workflow);
446-
447-
Map<String, Object> output =
448-
workflowDefinition.instance(Map.of()).start().join().asMap().orElseThrow();
449-
450-
assertEquals(Map.of("message", "hello world!"), output);
451-
}
452-
}
453435
}

experimental/lambda/src/test/java/io/serverless/workflow/impl/executors/func/FluentDSLCallTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static io.serverlessworkflow.fluent.func.dsl.FuncDSL.function;
1919
import static org.assertj.core.api.Assertions.assertThat;
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
2021

2122
import io.serverlessworkflow.api.types.FlowDirectiveEnum;
2223
import io.serverlessworkflow.api.types.Workflow;
@@ -26,6 +27,7 @@
2627
import io.serverlessworkflow.impl.WorkflowInstance;
2728
import java.util.Collection;
2829
import java.util.List;
30+
import java.util.Map;
2931
import java.util.concurrent.ExecutionException;
3032
import org.junit.jupiter.api.Test;
3133

@@ -112,4 +114,21 @@ void testSwitch() throws InterruptedException, ExecutionException {
112114
assertThat(definition.instance(4).start().get().asNumber().orElseThrow()).isEqualTo(0);
113115
}
114116
}
117+
118+
@Test
119+
void set_with_map() {
120+
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
121+
Workflow workflow =
122+
FuncWorkflowBuilder.workflow()
123+
.tasks(f -> f.set(s -> s.expr(Map.of("message", "hello world!"))))
124+
.build();
125+
126+
WorkflowDefinition workflowDefinition = app.workflowDefinition(workflow);
127+
128+
Map<String, Object> output =
129+
workflowDefinition.instance(Map.of()).start().join().asMap().orElseThrow();
130+
131+
assertEquals(Map.of("message", "hello world!"), output);
132+
}
133+
}
115134
}

0 commit comments

Comments
 (0)