Skip to content

Commit 8badf9c

Browse files
committed
Fix http flaky test
The pet API might randomly return a 404. Signed-off-by: Francisco Javier Tirado Sarti <ftirados@redhat.com>
1 parent 1905651 commit 8badf9c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ void testWrongSchema(String fileName) {
6262
.hasMessageContaining("There are JsonSchema validation errors");
6363
}
6464

65+
private static boolean httpCondition(Object obj) {
66+
Map<String, Object> map = (Map<String, Object>) obj;
67+
return map.containsKey("photoUrls") || map.containsKey("petId");
68+
}
69+
6570
private static Stream<Arguments> provideParameters() {
6671
Map<String, Object> petInput = Map.of("petId", 10);
6772
Map<String, Object> starTrekInput = Map.of("uid", "MOMA0000092393");
6873
Condition<Object> petCondition =
69-
new Condition<>(
70-
o -> ((Map<String, Object>) o).containsKey("photoUrls"), "callHttpCondition");
74+
new Condition<>(HTTPWorkflowDefinitionTest::httpCondition, "callHttpCondition");
7175
Condition<Object> starTrekCondition =
7276
new Condition<>(
7377
o ->

0 commit comments

Comments
 (0)