SmartCarIndexServiceTest.java 1.29 KB
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;
            }
        }
    }
}