use of org.onebusaway.transit_data_federation.model.narrative.AgencyNarrative in project onebusaway-application-modules by camsys.
the class AgencyBeanServiceImpl method getAgencyForId.
@Cacheable
public AgencyBean getAgencyForId(String id) {
AgencyNarrative agency = _narrativeService.getAgencyForId(id);
if (agency == null)
return null;
AgencyBean bean = new AgencyBean();
bean.setId(id);
bean.setLang(agency.getLang());
bean.setName(agency.getName());
bean.setPhone(agency.getPhone());
bean.setEmail(agency.getEmail());
bean.setTimezone(agency.getTimezone());
bean.setUrl(agency.getUrl());
bean.setDisclaimer(agency.getDisclaimer());
bean.setPrivateService(agency.isPrivateService());
bean.setFareUrl(agency.getFareUrl());
bean.setEmail(agency.getEmail());
return bean;
}
use of org.onebusaway.transit_data_federation.model.narrative.AgencyNarrative in project onebusaway-application-modules by camsys.
the class GenerateNarrativesTaskTest method testGenerateAgencyNarratives.
@Test
public void testGenerateAgencyNarratives() {
Agency agency = new Agency();
agency.setId("1");
agency.setLang("en");
agency.setName("Agency");
agency.setPhone("555-1234");
agency.setTimezone("America/New_York");
agency.setUrl("http://agency.gov/");
Mockito.when(_gtfsDao.getAllAgencies()).thenReturn(Arrays.asList(agency));
Modification mod = new Modification();
mod.setType(AgencyNarrative.class);
mod.setId("1");
mod.setProperty("disclaimer");
mod.setValue("Use at your own risk.");
_modifications.setModifications(Arrays.asList(mod));
_task.generateAgencyNarratives(_provider);
AgencyNarrative narrative = _provider.getNarrativeForAgencyId("1");
assertEquals(mod.getValue(), narrative.getDisclaimer());
assertEquals(agency.getLang(), narrative.getLang());
assertEquals(agency.getName(), narrative.getName());
assertEquals(agency.getPhone(), narrative.getPhone());
assertEquals(agency.getTimezone(), narrative.getTimezone());
assertEquals(agency.getUrl(), narrative.getUrl());
}
Aggregations