我有一个启动ThreadPool
并返回Executor
对象的方法。下面提供了代码
@Configuration
@EnableAsync
@ComponentScan( "com.xyz.bbb.ccc" )
public class EllaConfiguration {
@Bean( "threadPoolExecutor" )
public Executor threadPoolTaskExecutor() {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.initialize();
return taskExecutor;
}
}
如何对方法进行单元测试?