I have a statement shown below which i need to test/verify call to:
snmpDispatchDelegateExecutor.submit(() -> processRunFunctionException(exception));
now it contains many things at once (Async calls , lambda and private methods all in one ), so i have some questions : 1: for handling submit() call which return future tasks. do i have to do something like
when(snmpDispatchDelegateExecutorMock.submit(any()/Runnable)).thenReturn(any()/FutureTask).
then the problem is how to achieve it (creating Runnable and Future). Tried creating both looks complex .
2: processRunFunctionException(exception) is a private method ,do we need to cover that , lot of "SO" posts says no need to cover private methods . In general if i focus on covering public methods private method should get covered as well . referred this
3: How to work with lambda expression here . went through link but no much help.