fjtirado commented on code in PR #3756:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3756#discussion_r1824384233


##########
kogito-serverless-workflow/kogito-serverless-workflow-executor-core/src/test/java/org/kie/kogito/serverless/workflow/executor/StaticWorkflowApplicationTest.java:
##########
@@ -107,6 +109,17 @@ void interpolationFile(String fileName, WorkflowFormat 
format) throws IOExceptio
         }
     }
 
+    @Test
+    void testValidationError() throws IOException {
+        try (Reader reader = new 
InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream("wrong.sw.json"));
+                StaticWorkflowApplication application = 
StaticWorkflowApplication.create()) {
+            Workflow workflow = getWorkflow(reader, WorkflowFormat.JSON);
+            ValidationException validationException = catchThrowableOfType(() 
-> application.process(workflow), ValidationException.class);
+            
assertThat(validationException.getErrors()).hasSizeGreaterThanOrEqualTo(4);

Review Comment:
   The validation errors are a mix of Sonataflow parser errors (which we 
control) and engine validation errors (which we do not control), so, in order 
to not tie the unit test too much with the engine implementation, we consider 
it is ok is there are at least 4 validation errors (one for transition, one for 
missing error, one for not existing function and another for not connected 
state) and also check the final exception message contains the four significant 
strings



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to