public class SomeclassTobeTested {
public int doSomethingAndSendMail(){
//... doing something
SomeStaticClass.sendEmail(args);
}
}
Public static SomeStaticClass implements Runnable{
public void run(){
sendMail();
}
public static void senMail(args){
//starts the thread
}
}
public class TestSomeClassToBeTested{
}
So now I have to verify whether sendEmail
was called from doSomethingAndSendMail()
? Which class should I mock? And not actually send the email.