Instantly share code, notes, and snippets.

Embed
What would you like to do?
The easy way to disable @ Async annotation for test contexts. This can be used to disable @ Scheduled annotation as well.
package ...configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableAsync;
@Configuration
@EnableAsync
@Profile("!test")
public class AsyncConfiguration {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment