I am new to mockito using it for unit testing. I need some help to understand mock a method.I have a method - method1() of class A which needs to be tested .Here i want to verify that execute() is executed (Interaction testing).Below is the method.
class A{
void method1(){
B b = new B(org_id);
b.execute();
}
}
Class B {
B(String orgId){
this.orgId = org_id;
}
void execute(){
String x = Dependency.m1();
String y = Dependency.m2();
}
static class Dependency{
public String m1(){
return K.someText();
}
public String m2(){
return K.someText();
}
}
}
Could anyone help me how to achieve it?TIA