- Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
If an application defines a @Scheduled(fixedRateString = "PT6H") tasks, then this task will be running on any @SpringBootTest junit test that does not explicit mock the bean containing the scheduled task.
@Service public class SchedulerService { @Scheduled(fixedRateString = "PT6H") public void runOnStartup() { } } This gets tedious if there are many more @Scheduled tasks in the application that launch on startup by usage of fixedRate or fixedRateString.
It would be great if there could be a possibility to completely deactivate the execution of @Scheduled tasks in junit.
Just like it is possible to deactivate any @Cacheable annotation by simply setting spring.cache.type=none dring junit tests.
Something like: spring.enable.scheduling=false (default: true)
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement