File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed
java/io/serverlessworkflow/api Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ $defs:
202
202
call :
203
203
type : string
204
204
const : asyncapi
205
+ enum : [asyncapi]
205
206
with :
206
207
type : object
207
208
title : AsyncApiArguments
@@ -247,6 +248,7 @@ $defs:
247
248
call :
248
249
type : string
249
250
const : grpc
251
+ enum : [grpc]
250
252
with :
251
253
type : object
252
254
title : GRPCArguments
@@ -301,7 +303,8 @@ $defs:
301
303
properties :
302
304
call :
303
305
type : string
304
- const : http
306
+ const : http
307
+ enum : [http]
305
308
with :
306
309
type : object
307
310
title : HTTPArguments
@@ -350,6 +353,7 @@ $defs:
350
353
call :
351
354
type : string
352
355
const : openapi
356
+ enum : [openapi]
353
357
with :
354
358
type : object
355
359
title : OpenAPIArguments
@@ -1351,4 +1355,4 @@ $defs:
1351
1355
type : string
1352
1356
title : RuntimeExpression
1353
1357
description : A runtime expression.
1354
- pattern : " ^\\ s*\\ $\\ {.+\\ }\\ s*$"
1358
+ pattern : " ^\\ s*\\ $\\ {.+\\ }\\ s*$"
Original file line number Diff line number Diff line change 18
18
import static io .serverlessworkflow .api .WorkflowReader .readWorkflowFromClasspath ;
19
19
import static org .assertj .core .api .Assertions .assertThat ;
20
20
21
+ import io .serverlessworkflow .api .types .CallFunction ;
21
22
import io .serverlessworkflow .api .types .CallHTTP ;
22
23
import io .serverlessworkflow .api .types .CallTask ;
23
24
import io .serverlessworkflow .api .types .Task ;
27
28
28
29
public class ApiTest {
29
30
31
+ @ Test
32
+ void testCallFunctionAPIWithoutArguments () throws IOException {
33
+ Workflow workflow = readWorkflowFromClasspath ("features/callFunction.yaml" );
34
+ assertThat (workflow .getDo ()).isNotEmpty ();
35
+ assertThat (workflow .getDo ().get (0 ).getName ()).isNotNull ();
36
+ assertThat (workflow .getDo ().get (0 ).getTask ()).isNotNull ();
37
+ Task task = workflow .getDo ().get (0 ).getTask ();
38
+ CallTask callTask = task .getCallTask ();
39
+ assertThat (callTask ).isNotNull ();
40
+ assertThat (callTask .get ()).isInstanceOf (CallFunction .class );
41
+ if (callTask .get () instanceof CallFunction ) {
42
+ CallFunction functionCall = callTask .getCallFunction ();
43
+ assertThat (functionCall ).isNotNull ();
44
+ assertThat (callTask .getCallAsyncAPI ()).isNull ();
45
+ assertThat (functionCall .getWith ()).isNull ();
46
+ }
47
+ }
48
+
30
49
@ Test
31
50
void testCallHTTPAPI () throws IOException {
32
51
Workflow workflow = readWorkflowFromClasspath ("features/callHttp.yaml" );
Original file line number Diff line number Diff line change
1
+ document :
2
+ dsl : 1.0.0-alpha1
3
+ namespace : default
4
+ name : http-call-with-response-output
5
+
6
+ use :
7
+ functions :
8
+ getPet :
9
+ call : http
10
+ with :
11
+ method : get
12
+ endpoint :
13
+ uri : https://petstore.swagger.io/v2/pet/{petId}
14
+ output : response
15
+
16
+ do :
17
+ - getPetFunctionCall :
18
+ call : getPet
You can’t perform that action at this time.
0 commit comments