|
16 | 16 | package io.serverlessworkflow.impl;
|
17 | 17 |
|
18 | 18 | import static io.serverlessworkflow.api.WorkflowReader.readWorkflowFromClasspath;
|
| 19 | +import static io.serverlessworkflow.api.WorkflowReader.validation; |
19 | 20 | import static org.assertj.core.api.Assertions.assertThat;
|
20 | 21 | import static org.assertj.core.api.Assertions.catchThrowableOfType;
|
21 | 22 |
|
@@ -52,58 +53,35 @@ static void init() {
|
52 | 53 | @MethodSource("provideParameters")
|
53 | 54 | void testWorkflowExecution(String fileName, Consumer<WorkflowDefinition> assertions)
|
54 | 55 | throws IOException {
|
55 |
| - assertions.accept(appl.workflowDefinition(readWorkflowFromClasspath(fileName))); |
| 56 | + assertions.accept(appl.workflowDefinition(readWorkflowFromClasspath(validation(), fileName))); |
56 | 57 | }
|
57 | 58 |
|
58 | 59 | private static Stream<Arguments> provideParameters() {
|
59 | 60 | return Stream.of(
|
60 | 61 | args(
|
61 | 62 | "switch-then-string.yaml",
|
62 | 63 | Map.of("orderType", "electronic"),
|
63 |
| - o -> |
64 |
| - assertThat(o.output()) |
65 |
| - .isEqualTo( |
66 |
| - Map.of( |
67 |
| - "orderType", "electronic", "validate", true, "status", "fulfilled"))), |
| 64 | + o -> assertThat(o.output()).isEqualTo(Map.of("validate", true, "status", "fulfilled"))), |
68 | 65 | args(
|
69 | 66 | "switch-then-string.yaml",
|
70 | 67 | Map.of("orderType", "physical"),
|
71 | 68 | o ->
|
72 | 69 | assertThat(o.output())
|
73 |
| - .isEqualTo( |
74 |
| - Map.of( |
75 |
| - "orderType", |
76 |
| - "physical", |
77 |
| - "inventory", |
78 |
| - "clear", |
79 |
| - "items", |
80 |
| - 1, |
81 |
| - "address", |
82 |
| - "Elmer St"))), |
| 70 | + .isEqualTo(Map.of("inventory", "clear", "items", 1, "address", "Elmer St"))), |
83 | 71 | args(
|
84 | 72 | "switch-then-string.yaml",
|
85 | 73 | Map.of("orderType", "unknown"),
|
86 | 74 | o ->
|
87 | 75 | assertThat(o.output())
|
88 |
| - .isEqualTo( |
89 |
| - Map.of( |
90 |
| - "orderType", |
91 |
| - "unknown", |
92 |
| - "log", |
93 |
| - "warn", |
94 |
| - "message", |
95 |
| - "something's wrong"))), |
| 76 | + .isEqualTo(Map.of("log", "warn", "message", "something's wrong"))), |
96 | 77 | args(
|
97 | 78 | "for-sum.yaml",
|
98 | 79 | Map.of("input", Arrays.asList(1, 2, 3)),
|
99 | 80 | o -> assertThat(o.output()).isEqualTo(6)),
|
100 | 81 | args(
|
101 | 82 | "for-collect.yaml",
|
102 | 83 | Map.of("input", Arrays.asList(1, 2, 3)),
|
103 |
| - o -> |
104 |
| - assertThat(o.output()) |
105 |
| - .isEqualTo( |
106 |
| - Map.of("input", Arrays.asList(1, 2, 3), "output", Arrays.asList(2, 4, 6)))), |
| 84 | + o -> assertThat(o.output()).isEqualTo(Map.of("output", Arrays.asList(2, 4, 6)))), |
107 | 85 | args(
|
108 | 86 | "simple-expression.yaml",
|
109 | 87 | Map.of("input", Arrays.asList(1, 2, 3)),
|
|
0 commit comments