feiyu02
2025-09-30 94fee0b511279679b43e210878d3d36e5a14384b
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.flightfeather.uav.lightshare.service.impl
 
import com.flightfeather.uav.lightshare.bean.AreaVo
import com.flightfeather.uav.lightshare.service.DataAnalysisService
import junit.framework.TestCase
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.*
 
@RunWith(SpringRunner::class)
@SpringBootTest
class DataAnalysisServiceImplTest{
 
    @Autowired
    lateinit var dataAnalysisService: DataAnalysisService
 
    val startTime = Date.from(LocalDateTime.of(2025,7,1,0,0,0).atZone(ZoneId.systemDefault()).toInstant())
    val endTime = Date.from(LocalDateTime.of(2025, 9, 30, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant())
    val areaVo = AreaVo().apply {
        provinceCode = "31"
        cityCode = "3100"
        districtCode = "310106"
    }
 
    @Test
    fun testPollutionTrace() {
        dataAnalysisService.pollutionTrace("SH-CN-20250116")
    }
 
    @Test
    fun fetchHistory() {
        dataAnalysisService.fetchHistory("SH-CN-20250723(01)")
    }
 
    @Test
    fun generateMissionList() {
        val res = dataAnalysisService.generateMissionList(startTime, endTime, areaVo)
        println(res)
    }
 
    @Test
    fun generateMissionDetail() {
        val res = dataAnalysisService.generateMissionDetail(startTime, endTime, areaVo)
        println(res)
    }
 
    @Test
    fun generateClueByRiskArea() {
        val res = dataAnalysisService.generateClueByRiskArea(startTime, endTime, areaVo)
        println(res)
    }
}