I have a JUnit test that reads
public class EventHandlerTest {
@Mock
ThreadPoolExtendedExecutor threadPoolExtendedExecutor;
private EventHandler handler;
private Map<Queue<SenderTask>> subBuffers = new HashMap<>();
@Before
public void setUp() {
// PROBLEM: threadPoolExtendedExecutor null!
handler = new EventHandler(subBuffers, threadPoolExtendedExecutor);
}
}
When I call new in setUp, I have threadPoolExtendedExecutor=null
.
I would like to insert some mocked threadPoolExtendedExecutor
so, I do not have NullPointer
problems when calling its methods (so simple interface mock is enough for me at this moment)