Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ void testWrongSchema(String fileName) {
.hasMessageContaining("There are JsonSchema validation errors");
}

private static boolean httpCondition(Object obj) {
Map<String, Object> map = (Map<String, Object>) obj;
return map.containsKey("photoUrls") || map.containsKey("petId");
}

private static Stream<Arguments> provideParameters() {
Map<String, Object> petInput = Map.of("petId", 10);
Map<String, Object> starTrekInput = Map.of("uid", "MOMA0000092393");
Condition<Object> petCondition =
new Condition<>(
o -> ((Map<String, Object>) o).containsKey("photoUrls"), "callHttpCondition");
new Condition<>(HTTPWorkflowDefinitionTest::httpCondition, "callHttpCondition");
Condition<Object> starTrekCondition =
new Condition<>(
o ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ document:
name: call-http-shorthand-endpoint
version: '0.1.0'
do:
- getPet:
call: http
with:
headers:
content-type: application/json
method: get
endpoint: ${ "https://petstore.swagger.io/v2/pet/\(.petId)" }
- tryGetPet:
try:
- getPet:
call: http
with:
headers:
content-type: application/json
method: get
endpoint: ${ "https://petstore.swagger.io/v2/pet/\(.petId)" }
catch:
errors:
with:
type: https://serverlessworkflow.io/spec/1.0.0/errors/communication
status: 404
Loading