DeviceServiceTest.java
2.68 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package cn.com.glsx.dj.weapp.service;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.service.smartplus.DeviceService;
import cn.com.glsx.dj.weapp.util.ThreadLocalCache;
import cn.com.glsx.dj.weapp.vo.BindInfo;
import cn.com.glsx.dj.weapp.vo.DeviceStatusVO;
import cn.com.glsx.dj.wechat.model.WechatUserInfo;
import cn.com.glsx.framework.core.beans.ResultEntity;
public class DeviceServiceTest extends BaseServiceTest{
@Autowired
private DeviceService deviceService;
@Test
public void getDeviceListTest(){
String openId = "oQJW15H3h8Hp3splceTSl0uhfYNY";
Integer accountId = 91711868;
ThreadLocalCache.setAccountId(accountId);
ResultEntity<Map<String, Object>> resultEntity = deviceService.getDeviceList(openId);
System.out.println(resultEntity);
}
@Test
public void getAndReturnDeviceStatusTest(){
String unionId = "ojXE66JEioQsEoevD7scxmgnS8no";
Integer accountId = 91711868;
Integer userId = 13000080;
ThreadLocalCache.setAccountId(accountId);
ThreadLocalCache.setUnionId(unionId);
ResultEntity<DeviceStatusVO> resultEntity = deviceService.getAndReturnDeviceStatus(userId);
System.out.println(resultEntity);
}
@Test
public void getBindInfoListTest(){
Integer accountId = 91711868;
String sourcefrom = "";
WechatUserInfo wechatUserInfo = new WechatUserInfo();
wechatUserInfo.setAccountId(accountId);
List<BindInfo> bindInfoList = deviceService.getBindInfoList(wechatUserInfo, sourcefrom);
System.out.println(bindInfoList);
}
@Test
public void bindobdTest(){
Integer accountId = 91711868;
String imei = "1790114188";
String validateCode = "";
Integer typeId = 8;
String enter = "";
Integer merchantId = 44187636;
ResultEntity<Boolean> resultEntity = deviceService.bindobd(imei, validateCode,typeId,enter , accountId);
System.out.println(resultEntity);
}
@Test
public void newCarBindOBDTest(){
Integer accountId = 91711868;
String imei = "1790114188";
String validateCode = "";
Integer typeId = 8;
ResultEntity<Integer> resultEntity = deviceService.newCarBindOBD(imei, validateCode,typeId , accountId);
System.out.println(resultEntity);
}
@Test
public void isNoVehicleTest(){
Integer accountId = 91711868;
Integer typeId = 8;
ResultEntity<Integer> resultEntity = deviceService.isNoVehicle(typeId , accountId);
System.out.println(resultEntity);
}
}