I have a class implements Runnable like this
public Processor implements Runnable{
public void run() {
while (true) {
//some code
sendRequest(object);
}
}
}
public void sendRequest(Object, object){
// do something to send the event
}
}
And in other pre-load class. I use
Processor processor = new Processor();
ExecutorService executor = Executors.newCachedThreadPool();
executor.execute(processor)
So my question is how can I unit test sendRequest method is called or not?