FenceDriverServiceTest.java 1.12 KB
package cn.com.glsx.stdinterface.modules.service;

import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.modules.mapper.VehicleDeviceMapper;
import cn.com.glsx.stdinterface.modules.entity.VehicleDevice;
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;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class FenceDriverServiceTest {

    @Autowired
    private VehicleDeviceMapper vehicleDeviceMapper;

    @Test
    void insertFenceDrive() {
        VehicleDevice vehicleDevice = new VehicleDevice();
        vehicleDevice.setSn("8701205912");
        vehicleDevice.setBindStatus(1);
        vehicleDevice.setDelFlag(0);
        VehicleDevice device = vehicleDeviceMapper.selectOne(vehicleDevice);
        System.out.println("device = " + JSON.toJSONString(device));
    }
}