I have the following class
public class EmailManager{
protected String getEmailContent(String content,String image){
String result = content.toPrettyLook(); //this is an inner method
result+="<img src='" + +"' />";
return result;
}
protected String getImageLocation(String image){
//write image to disc
return newLocation;
}
}
public class EmailManagerTest{
EmailManager emailManager;
@Test
public void testEmailContent(){
String result = emailManager.getEmailContent("Hello World");
}
}
What annotation should I put above EmailManager? @Spy @Mock or @Autowired?
How can I tell Mockito not to execute getImageLocation (the method that is being called by getEmailContent) and always returns instead of it "new location"? I saw many articles and got confused between "when" "stub" "doReturn"