martinweiler commented on code in PR #3890:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3890#discussion_r2054803451


##########
jbpm/jbpm-flow/src/test/java/org/jbpm/process/instance/LightProcessRuntimeTest.java:
##########
@@ -81,4 +85,28 @@ void testInstantiation() {
 
     }
 
+    @Test
+    void testCreateTimerInstance() {
+        LightProcessRuntimeServiceProvider services =
+                new LightProcessRuntimeServiceProvider();
+
+        MyProcess myProcess = new MyProcess();
+        LightProcessRuntimeContext rtc = new 
LightProcessRuntimeContext(Collections.singletonList(myProcess.process));
+
+        Application application = mock(Application.class);
+        InternalKnowledgeRuntime runtime = 
mock(InternalKnowledgeRuntime.class);
+        
when(runtime.getEnvironment()).thenReturn(mock(org.kie.api.runtime.Environment.class));
+        Config config = mock(Config.class);
+        when(application.config()).thenReturn(config);
+        when(config.get(any())).thenReturn(mock(AbstractProcessConfig.class));
+        
when(application.get(Processes.class)).thenReturn(mock(Processes.class));
+        LightProcessRuntime rt = new LightProcessRuntime(rtc, services, 
application);
+        Timer timer = new Timer();
+        timer.setTimeType(Timer.TIME_CYCLE);
+        timer.setDelay("R5/PT10S");
+        ExpirationTime timerInstance = rt.createTimerInstance(timer, runtime);
+        assertEquals(5, timerInstance.repeatLimit());
+        assertEquals(10000L, timerInstance.repeatInterval());
+    }
+

Review Comment:
   @Abhitocode thanks for adding a test. However, I have my doubts that this 
test actually addresses the issue reported in 
https://github.com/apache/incubator-kie-issues/issues/1922. The test should 
actually invoke the `initStartTimers` method.
   
   ```
   at 
org.jbpm.process.instance.LightProcessRuntime.initStartTimers(LightProcessRuntime.java:93)
   ```
   



-- 
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