springboot 单元测试

 

 

package com.cx.shop.scheduler.test;

import com.cx.shop.SchedulerProviderApplication;
import com.cx.shop.scheduler.service.TaskJobService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@SpringBootTest(classes = SchedulerProviderApplication.class)
@RunWith(SpringRunner.class)
public class TaskTest {

    @Resource
    private TaskJobService taskJobService;

    @Test
    public void conflictTime() {
        this.taskJobService.runOnce(1732589160625348609L);
    }

}

 

posted @ 2024-02-19 10:47  fnasklf  阅读(7)  评论(0编辑  收藏  举报