I have a method like the following,
public void generateCSVFile(final Date billingDate) {
asyncTaskExecutor.execute(new Runnable() {
public void run() {
try {
accessService.generateCSVFile(billingDate);
} catch (Exception e) {
LOG.error(e.getMessage());
}
}
});
}
I have mocked:
PowerMockito.doNothing().when(accessService).generateCSVFile(billingDate);
But when I verify:
verify(rbmPublicViewAccessService, timeout(100).times(1)).generateCSVFile(billingDate);
It gives me as not invoked. Is this because it is invoked via separate thread, and is it possible to verify the methods called in different thread?