There is a code written by someone who had called completable future to do an activity that is a call and forget i.e. output is not looked after (no get()
call).
CompletableFuture.runAsync(() -> {
List<ActivityListTO> activities = auditCount(requestType, oldLimit, rule, newLimit);
few mores lines here.
...
, executor);
I was unit testing this but unable to execute the code inside of async.
I cannot static mock it as I need to execute the code inside it. I tried passing the thread pool instance in my testcase but it did not go.
Could you provide me some hints on how can I unit test the code inside async?