Код: Выделить всё
class Parent{
public String calculate(String input){
// does lots of external system calls and complex calculations
}
}
Код: Выделить всё
public abstract class AbsChild extends Parent{
public String calculatePayments(String abc, String xyz){
String ZXC = doSomething(abc);
// more code
}
private String doSomething(String abc){
String STR = super.calculate(abc);
// more code
}
}
Вот что я пробовал.
Код: Выделить всё
public class AbsChildTest extends AbsChild{
@Test
public void testCalculatePayments(){
Parent parent = mock(Parent.class);
when(parent.calculate(anyString())).thenReturn("str");
this.calculatePayments("abc", "xyz");
}
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... of-its-non