-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[incubator-kie-issues-1131] test migration from V7 to code generation-28 #3651
base: main
Are you sure you want to change the base?
Conversation
assertProcessInstanceAborted(processInstance.getStringId() + 1, kruntime); | ||
|
||
assertProcessVarValue(processInstance, "event", "error desde Subproceso"); | ||
Application app = ProcessTestHelper.newApplication(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to declare both process
Application app = ProcessTestHelper.newApplication();
ProcessTestHelper.registerProcessEventListener(app, new DefaultKogitoProcessEventListener() {
@Override
public void afterProcessCompleted(ProcessCompletedEvent event) {
if ("ErrorsBetweenSubProcess".equals(event.getProcessInstance().getProcessId())) {
assertThat(event.getProcessInstance().getState()).isEqualTo(ProcessInstance.STATE_ABORTED);
}
}
});
ErrorsBetweenSubProcessProcess.newProcess(app);
org.kie.kogito.process.Process<ErrorsBetweenProcessModel> process = ErrorsBetweenProcessProcess.newProcess(app);
ErrorsBetweenProcessModel model = process.createModel();
model.setTipoEvento("error");
model.setPasoVariable(3);
ProcessInstance<ErrorsBetweenProcessModel> processInstance = process.createInstance(model);
processInstance.start();
assertThat(processInstance.status()).isEqualTo(ProcessInstance.STATE_COMPLETED);
Assertions.assertEquals("error desde Subproceso", processInstance.variables().getEvent());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrated as above and created a separate pr for the same #3665. Thank you @elguardian : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix
74e328a
to
2f99cd0
Compare
Below are the tests with issues, commented the same for each test.
1. CompensationTest
It appears there are a few nodes that are missing outbound or inbound connections. The BPMN editor didn't indicate any problems, but it turns out that these nodes have no connection to the start node.
error:
java.lang.IllegalStateException: Process could not be validated ![Process 'Default Process' [InSubSubProcess]: Node 'Boundary Compensate 3' [_X-1] Event has no outgoing connection
Process 'Default Process' [InSubSubProcess]: Node 'Compensate Handler 3' [_X-2] Action has no incoming connection.,
Process 'Default Process' [InSubSubProcess]: Node 'Boundary Compensate 2' [_Y-1] Event has no outgoing connection,
Process 'Default Process' [InSubSubProcess]: Node 'Compensate Handler 2' [_Y-2] Action has no incoming connection.,
Process 'Default Process' [InSubSubProcess]: Node 'Compensate Handler 3' [_X-2] Has no connection to the start node.,
Process 'Default Process' [InSubSubProcess]: Node 'Compensate Handler 2' [_Y-2] Has no connection to the start node.]*
2. DataTest
testDataStore and testAssociation
When compiling the code, we cannot resolve method 'metaData' in 'Process'.
As I understand, the metaData() method is protected, and thus, it isn't directly accessible in the test class.
How to get process metadata from the process object(only then we can get the definition metadata).
testDefaultProcessVariableValue
CorrelationKeyModel does not have methods named getProcVar and getIntVar .
This may be due to acutal variables/methods being different in the CorrelationKeyModel.
guidance on above would be helpful.
Closes apache/incubator-kie-issues#1131.
Note: This pr contains tests with error, only for review purpose.