Last active
December 10, 2022 21:43
-
-
Save ufuk/16f5044f0b1a298b01a1251f0a5209cb to your computer and use it in GitHub Desktop.
The easy way to disable @ Async annotation for test contexts. Same approach can be used to disable @ Scheduled annotation as well.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | |
} |
thank you. eventually tests work without a pain in the neck
Thanks, this was helpful
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
worked, thanks