单元测试ThreadPoolTask​​Executor初始化

时间:2019-06-17 09:38:28

标签: java junit mockito

我有一个启动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;
    }
}

如何对方法进行单元测试?

0 个答案:

没有答案