|
25 | 25 | import io.serverlessworkflow.api.datainputschema.DataInputSchema; |
26 | 26 | import io.serverlessworkflow.api.defaultdef.DefaultConditionDefinition; |
27 | 27 | import io.serverlessworkflow.api.end.End; |
| 28 | +import io.serverlessworkflow.api.events.EventDefinition; |
28 | 29 | import io.serverlessworkflow.api.events.EventRef; |
29 | 30 | import io.serverlessworkflow.api.functions.FunctionDefinition; |
30 | 31 | import io.serverlessworkflow.api.functions.FunctionRef; |
|
39 | 40 | import io.serverlessworkflow.api.test.utils.WorkflowTestUtils; |
40 | 41 | import io.serverlessworkflow.api.timeouts.WorkflowExecTimeout; |
41 | 42 | import io.serverlessworkflow.api.workflow.Constants; |
| 43 | +import io.serverlessworkflow.api.workflow.Events; |
42 | 44 | import io.serverlessworkflow.api.workflow.Retries; |
43 | 45 | import io.serverlessworkflow.api.workflow.Secrets; |
44 | 46 | import java.util.List; |
@@ -852,4 +854,25 @@ public void testAnnotations(String workflowLocation) { |
852 | 854 | List<String> annotations = workflow.getAnnotations(); |
853 | 855 | assertEquals(4, annotations.size()); |
854 | 856 | } |
| 857 | + |
| 858 | + @ParameterizedTest |
| 859 | + @ValueSource(strings = {"/features/eventdefdataonly.json", "/features/eventdefdataonly.yml"}) |
| 860 | + public void testEventDefDataOnly(String workflowLocation) { |
| 861 | + Workflow workflow = Workflow.fromSource(WorkflowTestUtils.readWorkflowFile(workflowLocation)); |
| 862 | + |
| 863 | + assertNotNull(workflow); |
| 864 | + assertNotNull(workflow.getId()); |
| 865 | + assertNotNull(workflow.getName()); |
| 866 | + |
| 867 | + assertNotNull(workflow.getEvents()); |
| 868 | + Events events = workflow.getEvents(); |
| 869 | + assertNotNull(workflow.getEvents().getEventDefs()); |
| 870 | + assertEquals(2, events.getEventDefs().size()); |
| 871 | + EventDefinition eventDefOne = events.getEventDefs().get(0); |
| 872 | + EventDefinition eventDefTwo = events.getEventDefs().get(1); |
| 873 | + assertEquals("visaApprovedEvent", eventDefOne.getName()); |
| 874 | + assertFalse(eventDefOne.isDataOnly()); |
| 875 | + assertEquals("visaRejectedEvent", eventDefTwo.getName()); |
| 876 | + assertTrue(eventDefTwo.isDataOnly()); |
| 877 | + } |
855 | 878 | } |
0 commit comments