JUnit-testing a Spring @Async void service method

For @Async semantics to be adhered, some active @Configuration class will have the @EnableAsync annotation, e.g. @Configuration @EnableAsync @EnableScheduling public class AsyncConfiguration implements AsyncConfigurer { // } To resolve my issue, I introduced a new Spring profile non-async. If the non-async profile is not active, the AsyncConfiguration is used: @Configuration @EnableAsync @EnableScheduling @Profile(“!non-async”) public class … Read more