Skip to content

Commit e3db135

Browse files
committed
Remove comments on test used for debugging
1 parent 7fe8325 commit e3db135

File tree

1 file changed

+69
-69
lines changed

1 file changed

+69
-69
lines changed

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

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -34,84 +34,84 @@
3434

3535
public class HTTPWorkflowDefinitionTest {
3636

37-
private static WorkflowApplication appl;
37+
private static WorkflowApplication appl;
3838

39-
@BeforeAll
40-
static void init() {
41-
appl = WorkflowApplication.builder().build();
42-
}
39+
@BeforeAll
40+
static void init() {
41+
appl = WorkflowApplication.builder().build();
42+
}
4343

44-
@AfterAll
45-
static void cleanup() {
46-
appl.close();
47-
}
44+
@AfterAll
45+
static void cleanup() {
46+
appl.close();
47+
}
4848

49-
@ParameterizedTest
50-
@MethodSource("provideParameters")
51-
void testWorkflowExecution(String fileName, Object input, Condition<Object> condition)
52-
throws IOException {
53-
assertThat(
54-
appl.workflowDefinition(readWorkflowFromClasspath(fileName))
55-
.instance(input)
56-
.start()
57-
.join())
58-
.is(condition);
59-
}
49+
@ParameterizedTest
50+
@MethodSource("provideParameters")
51+
void testWorkflowExecution(String fileName, Object input, Condition<Object> condition)
52+
throws IOException {
53+
assertThat(
54+
appl.workflowDefinition(readWorkflowFromClasspath(fileName))
55+
.instance(input)
56+
.start()
57+
.join())
58+
.is(condition);
59+
}
6060

61-
@ParameterizedTest
62-
@ValueSource(
63-
strings = {
64-
"workflows-samples/call-http-query-parameters.yaml",
65-
"workflows-samples/call-http-query-parameters-external-schema.yaml"
66-
})
67-
void testWrongSchema(String fileName) {
68-
IllegalArgumentException exception =
69-
catchThrowableOfType(
70-
IllegalArgumentException.class,
71-
() -> appl.workflowDefinition(readWorkflowFromClasspath(fileName)).instance(Map.of()));
72-
assertThat(exception)
73-
.isNotNull()
74-
.hasMessageContaining("There are JsonSchema validation errors");
75-
}
61+
@ParameterizedTest
62+
@ValueSource(
63+
strings = {
64+
"workflows-samples/call-http-query-parameters.yaml",
65+
"workflows-samples/call-http-query-parameters-external-schema.yaml"
66+
})
67+
void testWrongSchema(String fileName) {
68+
IllegalArgumentException exception =
69+
catchThrowableOfType(
70+
IllegalArgumentException.class,
71+
() -> appl.workflowDefinition(readWorkflowFromClasspath(fileName)).instance(Map.of()));
72+
assertThat(exception)
73+
.isNotNull()
74+
.hasMessageContaining("There are JsonSchema validation errors");
75+
}
7676

77-
private static boolean httpCondition(WorkflowModel obj) {
78-
Map<String, Object> map = obj.asMap().orElseThrow();
79-
return map.containsKey("photoUrls") || map.containsKey("petId");
80-
}
77+
private static boolean httpCondition(WorkflowModel obj) {
78+
Map<String, Object> map = obj.asMap().orElseThrow();
79+
return map.containsKey("photoUrls") || map.containsKey("petId");
80+
}
8181

82-
private static Stream<Arguments> provideParameters() {
83-
Map<String, Object> petInput = Map.of("petId", 10);
84-
Map<String, Object> starTrekInput = Map.of("uid", "MOMA0000092393");
85-
Condition<WorkflowModel> petCondition =
86-
new Condition<>(HTTPWorkflowDefinitionTest::httpCondition, "callHttpCondition");
87-
Condition<WorkflowModel> starTrekCondition =
88-
new Condition<>(
89-
o ->
90-
((Map<String, Object>) o.asMap().orElseThrow().get("movie"))
91-
.get("title")
92-
.equals("Star Trek"),
93-
"StartTrek");
94-
return Stream.of(
82+
private static Stream<Arguments> provideParameters() {
83+
Map<String, Object> petInput = Map.of("petId", 10);
84+
Map<String, Object> starTrekInput = Map.of("uid", "MOMA0000092393");
85+
Condition<WorkflowModel> petCondition =
86+
new Condition<>(HTTPWorkflowDefinitionTest::httpCondition, "callHttpCondition");
87+
Condition<WorkflowModel> starTrekCondition =
88+
new Condition<>(
89+
o ->
90+
((Map<String, Object>) o.asMap().orElseThrow().get("movie"))
91+
.get("title")
92+
.equals("Star Trek"),
93+
"StartTrek");
94+
return Stream.of(
9595
Arguments.of("workflows-samples/callGetHttp.yaml", petInput, petCondition),
9696
Arguments.of(
97-
"workflows-samples/callGetHttp.yaml",
98-
Map.of("petId", "-1"),
99-
new Condition<WorkflowModel>(
100-
o -> o.asMap().orElseThrow().containsKey("petId"), "notFoundCondition")),
97+
"workflows-samples/callGetHttp.yaml",
98+
Map.of("petId", "-1"),
99+
new Condition<WorkflowModel>(
100+
o -> o.asMap().orElseThrow().containsKey("petId"), "notFoundCondition")),
101101
Arguments.of(
102-
"workflows-samples/call-http-endpoint-interpolation.yaml", petInput,
103-
petCondition),
102+
"workflows-samples/call-http-endpoint-interpolation.yaml", petInput,
103+
petCondition),
104104
Arguments.of(
105-
"workflows-samples/call-http-query-parameters.yaml", starTrekInput,
106-
starTrekCondition),
105+
"workflows-samples/call-http-query-parameters.yaml", starTrekInput,
106+
starTrekCondition),
107107
Arguments.of(
108-
"workflows-samples/call-http-query-parameters-external-schema.yaml",
109-
starTrekInput,
110-
starTrekCondition),
111-
Arguments.of(
112-
"workflows-samples/callPostHttp.yaml",
113-
Map.of("name", "Javierito", "surname", "Unknown"),
114-
new Condition<WorkflowModel>(
115-
o -> o.asText().orElseThrow().equals("Javierito"), "CallHttpPostCondition")));
116-
}
108+
"workflows-samples/call-http-query-parameters-external-schema.yaml",
109+
starTrekInput,
110+
starTrekCondition),
111+
Arguments.of(
112+
"workflows-samples/callPostHttp.yaml",
113+
Map.of("name", "Javierito", "surname", "Unknown"),
114+
new Condition<WorkflowModel>(
115+
o -> o.asText().orElseThrow().equals("Javierito"), "CallHttpPostCondition")));
116+
}
117117
}

0 commit comments

Comments
 (0)