Search in sources :

Example 1 with Modification

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());
}
Also used : Modification(org.onebusaway.transit_data_federation.model.modifications.Modification) Agency(org.onebusaway.gtfs.model.Agency) AgencyNarrative(org.onebusaway.transit_data_federation.model.narrative.AgencyNarrative) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Agency (org.onebusaway.gtfs.model.Agency)1 Modification (org.onebusaway.transit_data_federation.model.modifications.Modification)1 AgencyNarrative (org.onebusaway.transit_data_federation.model.narrative.AgencyNarrative)1