我有如下方法,
public void generateCSVFile(final Date billingDate) {
asyncTaskExecutor.execute(new Runnable() {
public void run() {
try {
accessService.generateCSVFile(billingDate);
} catch (Exception e) {
LOG.error(e.getMessage());
}
}
});
}
我嘲笑过:
PowerMockito.doNothing().when(accessService).generateCSVFile(billingDate);
但是当我验证时:
verify(rbmPublicViewAccessService, timeout(100).times(1)).generateCSVFile(billingDate);
它给了我没有被调用的感觉。这是因为它是通过单独的线程调用的,是否可以验证在不同线程中调用的方法?