zmc
2023-11-02 21427a082fc07bed414dbfe0473678d8aeb37006
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.flightfeather.monitor.scheduledtasks
 
 
import org.junit.Test
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.test.context.junit4.SpringRunner
import java.time.LocalDateTime
 
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@SpringBootTest
class DustAnalysisTaskTest {
 
    @Autowired
    lateinit var dustAnalysisTask: DustAnalysisTask
 
    @Test
    fun doTask() {
        var time = LocalDateTime.of(2023, 10, 31, 8, 0, 0)
        while (time.hour < 10) {
            dustAnalysisTask.doTask(time)
            time = time.plusMinutes(15)
            Thread.sleep(5000)
        }
    }
}