MasterHolidaySource extends AbstractMasterSource<Holiday, HolidayDocument, HolidayMaster> implements HolidaySource { @Override public Collection<Holiday> get(HolidayType holidayType, ExternalIdBundle regionOrExchangeIds) { HolidaySearchRequest request = createNonCurrencySearchRequest(holidayType, regionOrExchangeIds); return processDocuments(getMaster().search(request)); } MasterHolidaySource(final HolidayMaster master);  MasterHolidaySource(final HolidayMaster master, final boolean cacheCalendars); @Override Collection<Holiday> get(HolidayType holidayType,
                                 ExternalIdBundle regionOrExchangeIds); @Override Collection<Holiday> get(Currency currency); @Override boolean isHoliday(LocalDate dateToCheck, Currency currency); @Override boolean isHoliday(LocalDate dateToCheck, HolidayType holidayType, ExternalIdBundle regionOrExchangeIds); @Override boolean isHoliday(final LocalDate dateToCheck, final HolidayType holidayType, final ExternalId regionOrExchangeId);  }
@Test(expectedExceptions = DataNotFoundException.class) public void test_getHoliday_UniqueId_notFound() throws Exception { HolidayMaster mock = mock(HolidayMaster.class); when(mock.get(UID)).thenThrow(new DataNotFoundException("")); MasterHolidaySource test = new MasterHolidaySource(mock); try { test.get(UID); } finally { verify(mock, times(1)).get(UID); } }
@Test(expectedExceptions = DataNotFoundException.class) public void test_getHoliday_ObjectId_notFound() throws Exception { HolidayMaster mock = mock(HolidayMaster.class); when(mock.get(OID, VC)).thenThrow(new DataNotFoundException("")); MasterHolidaySource test = new MasterHolidaySource(mock); try { test.get(OID, VC); } finally { verify(mock, times(1)).get(OID, VC); } }