DeviceActiveServiceTest.java
1.59 KB
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
package cn.com.glsx.stdinterface.modules.service;
import java.util.Date;
import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.modules.entity.VehicleDevice;
import cn.com.glsx.stdinterface.modules.mapper.VehicleDeviceMapper;
import lombok.extern.slf4j.Slf4j;
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;
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class DeviceActiveServiceTest {
@Autowired
private DeviceActiveService deviceActiveService;
@Autowired
VehicleDeviceMapper vehicleDeviceMapper;
@Test
public void saveActiveInfoFlushAll() {
System.out.println("start===");
deviceActiveService.saveActiveInfoFlushAll();
System.out.println("end===");
}
@Test
public void test01() {
System.out.println("start===");
VehicleDevice vehicleDevice = new VehicleDevice();
vehicleDevice.setSn("1511213547");
vehicleDevice.setActiveLocationDate(new Date());
// vehicleDevice.setActiveLocationLng("114.025984");
// vehicleDevice.setActiveLocationLat("22.546064");
vehicleDevice.setActiveLocationType(0);
vehicleDevice.setActiveLocationAddress("广东省深圳市福田区展鹏足球俱乐部");
vehicleDeviceMapper.updateVehicleDeviceBysn(vehicleDevice);
System.out.println("end===");
}
}