public class ServiceIdOverlapCacheTest {
@Test
public void test() {
CalendarService calendarService = Mockito.mock(CalendarService.class);
TimeZone tz = TimeZone.getDefault();
AgencyAndId serviceIdA = new AgencyAndId("1", "serviceIdA");
AgencyAndId serviceIdB = new AgencyAndId("1", "serviceIdB");
AgencyAndId serviceIdC = new AgencyAndId("1", "serviceIdC");
AgencyAndId serviceIdD = new AgencyAndId("1", "serviceIdD");
LocalizedServiceId lsidA = new LocalizedServiceId(serviceIdA, tz);
LocalizedServiceId lsidB = new LocalizedServiceId(serviceIdB, tz);
LocalizedServiceId lsidC = new LocalizedServiceId(serviceIdC, tz);
LocalizedServiceId lsidD = new LocalizedServiceId(serviceIdD, tz);
Set<ServiceDate> serviceDatesA = set(new ServiceDate(2010, 9, 10),
new ServiceDate(2010, 9, 11));
Set<ServiceDate> serviceDatesB = set(new ServiceDate(2010, 9, 11),
new ServiceDate(2010, 9, 12));
Set<ServiceDate> serviceDatesC = set(new ServiceDate(2010, 9, 12),
new ServiceDate(2010, 9, 13));
Set<ServiceDate> serviceDatesD = set(new ServiceDate(2010, 9, 13));
Mockito.when(calendarService.getServiceDatesForServiceId(serviceIdA)).thenReturn(
serviceDatesA);
Mockito.when(calendarService.getServiceDatesForServiceId(serviceIdB)).thenReturn(
serviceDatesB);
Mockito.when(calendarService.getServiceDatesForServiceId(serviceIdC)).thenReturn(
serviceDatesC);
Mockito.when(calendarService.getServiceDatesForServiceId(serviceIdD)).thenReturn(
serviceDatesD);
ServiceIdOverlapCache cache = new ServiceIdOverlapCache();
cache.setCalendarService(calendarService);