I am new to JUnit & Mockito, the below class is defined with a method execute which needs to be tested, I wonder is it possible to mock this type of class ? Please shed some light and share your thoughts.
public class MyRule implements SuperRule{
private OrderList orderList;
private ScheduleList scheduleList;
public MyRule (OrderList orderList, ScheduleList scheduleList) {
this.orderList = orderList;
this.scheduleList = scheduleList;
}
@Override
public void execute() {
createWeeklyClassificationRule(orderList);
handle(scheduleList);
}
private void createWeeklyClassificationRule(OrderList orderList) {
//......
}
private void handle(ScheduleList scheduleList) {
//......
}
}