DeviceFreqServiceTest.java 1.31 KB
package cn.com.glsx.stdinterface.modules.service;

import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.dto.ActiveAdjFreqBO;
import lombok.extern.slf4j.Slf4j;
import org.junit.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;

/**
 * @author xiangyanlin
 * @date 2022/9/9
 */
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class DeviceFreqServiceTest {

    @Autowired
    private DeviceFreqService deviceFreqService;

    @Test
    public void testActivFreq() {
        long deadline = System.currentTimeMillis() + 1 * 3 * 1000;
        System.out.println(deadline);
        deviceFreqService.activeDeviceFreq(new ActiveAdjFreqBO("3010006020", deadline));
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        deviceFreqService.closeDeviceFreqFromCache();
    }

    @Test
    public void testCloseFreq() {

    }

    @Test
    public void testUpdateDeviceFreqResponseStatus() {
        deviceFreqService.updateDeviceFreqResponseStatus("2691212734");
    }

}