如果你不想使用配置文件,则可以添加标志以启用/禁用应用程序调度
在你
AppConfiguration添加此
@ConditionalOnProperty( value = "app.scheduling.enable", havingValue = "true", matchIfMissing = true ) @Configuration @EnableScheduling public static class SchedulingConfiguration { }在你的测试中,只需添加此注释即可禁用计划
@TestPropertySource(properties = "app.scheduling.enable=false")



