如何在ExecutorCompletionService上使用mock

时间:2017-04-13 10:48:47

标签: java junit mockito completion-service

我正在使用ExecutorCompletionService和来自

的方法调用
Future<List<Student>> studentDetails = taskCompletionService.take();
Lis<Student> details =studentDetails.get()

现在我正在写Junit和Mockito,我想模拟两个电话。我怎样才能做到这一点?

1 个答案:

答案 0 :(得分:0)

如果您只是想要存储模拟take的{​​{1}}方法,那么您可以执行以下操作:

taskCompletionService