Add a separate configuration class with @Profile(!test), @EnableScheduling annotations
1
2
3
4
@Profile(!test)
@Configuration
@EnableScheduling
public static class SpringConfiguration {}
Then either add the following line below in the test application.properties file to disable the spring scheduling for the test profile
1
spring.profiles.active=test
or add the following annotation @ActiveProfiles to a test class
1
@ActiveProfiles("test")
-
Previous
How to deploy a spring boot application into a Java EE Application Server -
Next
How to use swagger to document REST API: API first approach