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); } }