Sorry for my delayed response. I got pulled on another task and could
not investigate this problem further. This is not a multi-threading
problem as JC mentions because this is the only test I have. There
are no other tests. What seems to be happening is that my mocking of
the private method (getApptCalendarServiceBO of schedulerBean) seems
to be preventing the real method call (findAppointmentSearch of
schedulerBean). The private method is supposed to be called from the
findAppointmentSearch method but this real method never gets called.
Instead when I call this method in the test, it returns the result of
the mocked private method.
What we need to figure out is why is calling findAppointmentSearch
method is returning the result of mocked private method. Not sure how
much it will help but I here's the relevant code from schedulerBean
object anyway.
public ApptSearchResultInfoVO[]
findAppointmentSearch(AppointmentSearchVO appointmentSearchVO) {
VOAndDomainObjectConversion conversion=new
VOAndDomainObjectConversion();
IEScheduleAppt
tempieScheduleAppt=conversion.getIESchedApptFromAppointmentSearchVO(appointmentSearchVO);
ieScheduleApptList=getApptCalendarServiceBO().findAppointmentSearch(tempieScheduleAppt);
returnApptSearchResultInfoVOAry=conversion.getApptSearchResultInfoVO(ieScheduleApptList,
this.dailyDetailServiceBO,this.apptCalendarServiceBO);
return returnApptSearchResultInfoVOAry;
}
private IApptCalendarServiceBO getApptCalendarServiceBO() {
return apptCalendarServiceBO;
}
Thanks.
Danny