Following are the 2 classes defined as:
Class1{
public method1
{
class2.getInstance().method2();
}
}
Class2{
public static getInstance() { .... }
public method2() { .... }
public Class3 obj = new Class3();
}
I need to write junit test for method1 of class1. But I need to know how can I mock getInstance() and method2() of class2.
Also, please tell me how can I mock object of Class3.