在SpringBoot应用程序中运行JUnit测试时禁用调度程序

时间:2018-06-07 19:10:44

标签: spring-mvc spring-boot junit junit4 junit5

我在SpringBoot应用程序中定义了此服务。有一个预定的方法。有没有办法在运行JUnit测试时禁用调度程序?

@Profile({"prod", "acc"})
@Component 
public class ProdMenuPriceSummaryService extends 
MenuPriceSummaryService {


    @Scheduled(fixedRate = (10000)) 
    protected void cachedAllMenus() {

       ....

    }

0 个答案:

没有答案