SmartCarIndexServiceTest.java
1.29 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
package cn.com.glsx.dj.weapp.service;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.service.smartplus.JourneyServiceAsync;
import cn.com.glsx.dj.weapp.service.smartplus.SmartCarIndexService;
import cn.com.glsx.dj.weapp.vo.MyMileageVO;
import cn.com.glsx.dj.weapp.vo.SmartCarIndexVO;
public class SmartCarIndexServiceTest extends BaseServiceTest{
@Autowired
private SmartCarIndexService smartCarIndexService;
@Autowired
private JourneyServiceAsync journeyServiceAsync;
@Test
public void getIndexInfoTest(){
Integer userId = 13000080;
SmartCarIndexVO vo = smartCarIndexService.getIndexInfo(userId);
System.out.println(vo);
}
@Test
public void getMyMileageAsyncTest() throws ExecutionException, InterruptedException {
String deviceName = "";
Integer userId = 1;
Integer deviceId = 1;
Future<MyMileageVO> future = journeyServiceAsync.getMyMileageAsync(deviceName,userId,deviceId);
for(;;){
if (future.isDone()) {
MyMileageVO vo = future.get();
System.out.println(vo);
break;
}
}
}
}