欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

单元测试 调用service

程序员文章站 2022-04-26 09:14:40
...

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
public class TestService{
@Resource
private IService service;

@Test
public void job(){
    // 获取当前时间的前一天时间
    Date date = new Date();
    Date beforeDate = DateUtil.adjustToAddDays(date, 0);
    Date endDate = DateUtil.adjustBeforeWee(beforeDate);
    Date startDate = DateUtil.adjustToWee(beforeDate);
    servie.job(startDate,endDate);
}
相关标签: java java junit