use of org.onebusaway.transit_data_federation.model.modifications.Modification 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