Commit d8da4587 by 向延琳

add test

1 parent e52187a8
......@@ -509,7 +509,7 @@ public class VehicleMonitorService {
case ConstantsVehicle.RESIDENT_TYPE_THREE:
startDate = DateUtil.formatDate(DateUtil.getDayBefore(90, now));
break;
//前半个月
//前半年
case ConstantsVehicle.RESIDENT_TYPE_SIX:
startDate = DateUtil.formatDate(DateUtil.getDayBefore(180, now));
break;
......
package cn.com.glsx.admin.modules.remote;
import cn.com.glsx.Application;
import cn.com.glsx.devicemonitor.api.dto.request.StayPointRequest;
import cn.com.glsx.devicemonitor.api.dto.response.StayPointRecordDTO;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.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.util.Date;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
/**
* @author xiangyanlin
* @date 2022/5/17
*/
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class RemoteFeignStayPointServiceTest {
@Autowired
private RemoteFeignStayPointService remoteFeignStayPointService;
@Test
public void testGet() {
StayPointRequest request = new StayPointRequest();
request.setSn("60907150063");
request.setBeginTime(new Date(1640966400000L));
request.setEndTime(new Date(1652716800000L));
request.setPeriodType(0);
List<StayPointRecordDTO> stayPointRecord = remoteFeignStayPointService.getStayPointRecord(request);
System.out.println(JSON.toJSONString(stayPointRecord));
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!