I am new to mockito. Lets say I have a class like this
public class MyClass {
int a;
String b;
public MyClass(int a) {
this.a = a;
this.b = draw();
System.out.println("class is created");
}
public String draw() {
System.out.println("my");
return "b";
}
public void apple() {
System.out.println("apple");
}
}
I am writing a JUnit test using Mockito where I am creating a object of the class by using the constructor. Is it possible to mock the draw() method when I am instating the class?