1616import static org .junit .jupiter .api .Assertions .assertEquals ;
1717import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
1818import static org .junit .jupiter .api .Assertions .assertNotNull ;
19- import static org .junit .jupiter .api .Assertions .assertNull ;
2019
2120import java .util .ArrayList ;
2221import java .util .List ;
2322import org .flowable .bpmn .model .BpmnModel ;
2423import org .flowable .bpmn .model .CallActivity ;
2524import org .flowable .bpmn .model .FlowElement ;
25+ import org .flowable .bpmn .model .MultiInstanceLoopCharacteristics ;
2626import org .flowable .bpmn .model .Process ;
2727import org .junit .jupiter .api .Test ;
2828import org .openmetadata .schema .governance .workflows .WorkflowDefinition ;
@@ -60,7 +60,7 @@ void testPeriodicBatchTrigger_CreatesCorrectTriggerType() {
6060 }
6161
6262 @ Test
63- void testPeriodicBatchTrigger_NoMultiInstanceLoop () {
63+ void testPeriodicBatchTrigger_MultiInstanceLoop_WhenNoSinkTask () {
6464 WorkflowDefinition workflow = createWorkflow ();
6565
6666 TriggerInterface trigger = TriggerFactory .createTrigger (workflow );
@@ -70,9 +70,13 @@ void testPeriodicBatchTrigger_NoMultiInstanceLoop() {
7070
7171 CallActivity callActivity = findCallActivity (model );
7272 assertNotNull (callActivity , "CallActivity should exist" );
73- assertNull (
74- callActivity .getLoopCharacteristics (),
75- "CallActivity must not have multi-instance loop in batch mode" );
73+ MultiInstanceLoopCharacteristics loopChars =
74+ (MultiInstanceLoopCharacteristics ) callActivity .getLoopCharacteristics ();
75+ assertNotNull (loopChars , "CallActivity should have multi-instance loop when no SinkTask" );
76+ assertEquals (
77+ "${numberOfEntities}" ,
78+ loopChars .getLoopCardinality (),
79+ "Cardinality should be ${numberOfEntities} when no SinkTask batch mode" );
7680 }
7781
7882 private CallActivity findCallActivity (BpmnModel model ) {
0 commit comments