I have the following class and method get which I want to test:
public class MyClass{
private MyObject svc;
private MyObject2 svc2;
public MyClass(MyObject svc){
this.svc = svc;
this.svc2 = new MyObject2(svc);
}
public void getSvc(){
Result response = this.svc.getResponse();
if(!response.isEmpty())
this.svc2.filterResponse(response);
else
System.out.println("empty");
}
}
But I am struggling with being void method. How can I test that filterResponse will only get called when my response is not empty?