File tree Expand file tree Collapse file tree
src/test/kotlin/dev/starry/ktscheduler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,6 +113,24 @@ class InMemoryJobStoreTest {
113113 assertTrue(allJobs.contains(job2))
114114 }
115115
116+ @Test
117+ fun `getDueJobs should not return jobs with nextRuntime null` () {
118+ val job = Job (
119+ jobId = " job1" ,
120+ trigger = OneTimeTrigger (ZonedDateTime .now()),
121+ nextRunTime = null ,
122+ dispatcher = Dispatchers .Default ,
123+ callback = { /* Do nothing */ }
124+ )
125+ jobStore.addJob(job)
126+
127+ val currentTime = ZonedDateTime .now()
128+ val maxGraceTime = Duration .ofMinutes(1 )
129+
130+ val dueJobsWithGraceTime = jobStore.getDueJobs(currentTime, maxGraceTime)
131+ assertEquals(0 , dueJobsWithGraceTime.size)
132+ }
133+
116134 private fun createTestJob (jobId : String , nextRunTime : ZonedDateTime = ZonedDateTime .now()): Job {
117135 return Job (
118136 jobId = jobId,
You can’t perform that action at this time.
0 commit comments